I continue to receive and error in the base class declaration of "Pet" not being a class or struct, when i have included the parent classes header file.
hi James, updated code, & still no luck . I don't have to write the class declaration for dog, inside the pet class declaration do i? I thought that was whole point in having #include <ParentName.h>.
This code looks right, you must be doing something else wrong. Are you sure your files are in the same directory? It does not complain about #include "Pet.h" itself?
Also, it's generally a bad idea to say "using namespace" inside a header file, since any file which includes that header will be forced to use that namespace as well.
Thx BlackSheep, i'm using Visual C++ and the code is stored in "Projects". I have included the Pet.h header file inside the same project as the Dog.h file. I will re look at the Pet.h and i will cleanup "namespace" problem re-post code. GOING CRAZY, so simple it hurts !
Ok so i confirmed that if i put the Dog class declaration inside Pet.h, outside of the Pet class declaration everything works fine. The problem is why doesn't the proper way work ?? BTW "BlackSheep", if i remove the "namespace" i get an error on all string variables as being undefined. I still need help
You're sure your compiler didn't complain about #include "Pet.h" ? MVC++ usually warns you when it can't find a header file, and if it did find it Pet should have been declared.
Also, about the namespaces, just prepend std:: to all the objects or functions that come from the std namespace: