Search Results

Search found 1 results on 1 pages for 'gammaguy'.

Page 1/1 | 1 

  • Function returning pointer to struct

    - by GammaGuy
    I am having some issues with code that is returning a pointer to a struct declared inside a class. Here is my code so far: SortedList.h #ifndef SORTEDLIST_H #define SORTEDLIST_H class SortedList{ public: SortedList(); ... private: struct Listnode { Student *student; Listnode *next; }; static Listnode *copyList (Listnode *L); }; #endif SortedList.cpp #include "SortedList.h" ... // Here is where the problem lies Listnode SortedList::*copyList(Listnode *L) { return 0; // for NULL } Apparently, the copy list method wont compile. I am using Microsoft Visual Studio and the compiler tells me that "Listnode" is unidentified. When I try to compile, here is whhat I get: 1>------ Build started: Project: Program3, Configuration: Debug Win32 ------ 1> SortedList.cpp 1>c:\users\owner\documents\college\fall 2012\cs 368 - learn c++\program3\program3\sortedlist.cpp(159): error C2657: 'SortedList::*' found at the start of a statement (did you forget to specify a type?) 1>c:\users\owner\documents\college\fall 2012\cs 368 - learn c++\program3\program3\sortedlist.cpp(159): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\users\owner\documents\college\fall 2012\cs 368 - learn c++\program3\program3\sortedlist.cpp(159): error C2065: 'L' : undeclared identifier 1>c:\users\owner\documents\college\fall 2012\cs 368 - learn c++\program3\program3\sortedlist.cpp(159): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\users\owner\documents\college\fall 2012\cs 368 - learn c++\program3\program3\sortedlist.cpp(159): fatal error C1903: unable to recover from previous error(s); stopping compilation ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== Help would be greatly appreciated...ASAP

    Read the article

1