Suppose i have an animal base class and cat derived class..I create animal.cpp, animal.h, cat.cpp, and cat.h files...Assuming i have included Animal.h in my Cat files, what files do i have to include in the main.cpp file? is it just:
1) #include "Animal.h"
or do i also include:
2) #include "Cat.h"
The reason i ask is because when i try to create a Cat object in main.. with option 1), i get an error saying:
6 C:\Dev-Cpp\main1.cpp `Cat' undeclared (first use this function)
And with option 2) i get an error saying:
6 C:\Dev-Cpp\Animal.h redefinition of `class Animal'
I assume option 1) is the way to go but why am i getting this error??