using an ADT object [modified]
-
I am working on a C++ class project in MSVC. I have declared: class Node { private: . . . public . . . }; now in a separate file, I want to declare: class Employee { private: Node alphabetagamma; // for example . . public: . . . }; When I do this I get compile time errors indicating that the compiler does not recognize "Node" as a type of object. I am including the header files correctly in my implementation (.cpp) files. What am I forgetting? Thanks, Geoff:(( -- modified at 5:02 Friday 1st December, 2006
-
I am working on a C++ class project in MSVC. I have declared: class Node { private: . . . public . . . }; now in a separate file, I want to declare: class Employee { private: Node alphabetagamma; // for example . . public: . . . }; When I do this I get compile time errors indicating that the compiler does not recognize "Node" as a type of object. I am including the header files correctly in my implementation (.cpp) files. What am I forgetting? Thanks, Geoff:(( -- modified at 5:02 Friday 1st December, 2006
Spherelin wrote:
I am including the header files correctly in my implementation (.cpp) files
If you declare an instance of Node in your header file, then you need of course to include the header file of Node in thie file also (otherwise, the class Node is not recognized).
Cédric Moonen Software developer
Charting control [v1.1] -
Spherelin wrote:
I am including the header files correctly in my implementation (.cpp) files
If you declare an instance of Node in your header file, then you need of course to include the header file of Node in thie file also (otherwise, the class Node is not recognized).
Cédric Moonen Software developer
Charting control [v1.1]okay thanks - that fixed it! hey so if I am entering a number via a statement like: cin >> selection how do I clear cin for the next use. basically, user is going to enter a number (text entry program...for now). and then the next entry is going to be characters - like a name or state. Right now, it seems to take the strike of the return key as the second entry. THanks, G