Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. using an ADT object [modified]

using an ADT object [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Spherelin
    wrote on last edited by
    #1

    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

    C 1 Reply Last reply
    0
    • S Spherelin

      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

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      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]

      S 1 Reply Last reply
      0
      • C Cedric Moonen

        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]

        S Offline
        S Offline
        Spherelin
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups