I'm having some trouble using Inheritence classes in c++. I have my base class (Time.h) and my derived class is called (MilTime.h). I started writing my MilTime.cpp for the function definitions. Now, here is when I run into problems. I have a function in MilTime.h known as void setHours . Now when I try to type in the definition of the function, I do it like this:
void MilTime::setHours()
However, even though I am including MilTime.h, I get an error that says 'MilTime' is not a class name or definition name.
So my first question is..How do I define the functions of derived classes? What is the syntax? Or do I need to include the Time.h and Time.cpp in my MilTime.cpp?
Also...when I get to my main program...and how you usually declare a class object like this:
Time object;
Do I also have to do the same for the derived class like this:
MilTime object2;
Or does it get included with Time? What is the syantax for that? what do I have to do?