I don't see what this has to do with Inheritance, but hey!
When you use
return (int) CTimeSpan::GetSeconds() ;
Which instance of a CTimeSpan are you trying to get the number of seconds from? If you don't specify an instance, where is the seconds count going to come from?
It's like saying "what is the difference between these two?" and then not letting you see the contents of either of my hands!
"I am just typecasting the value returned by the function GetSeconds() of CTimeSpan class"
The
(int)
is indeed just a cast - from a
LONG
to an
int
The
CTimeSpan::GetSeconds()
bit is what I was talking about. You need to construct an instance:
CTimeSpan ts = SecondTime - FirstTime;
return (int) ts.GetSeconds();