I'm trying to construct a class "Time" that included a separate custom library "Date". I understand that a single colon after the Time constructor passes the rest of the arguments ( bmonth, bday, byear) to the constructors of the Date data members/objects, which is a member of class "Time", but it hasn't been working on me.
What is the proper syntax for this constructor of mixed classes?
Time::Time( int hr, int min, int sec, int bmonth, int bday, int byear ) //Arguments
{ setTime( hr, min, sec ); }
//Arguments for functions in Time class
: birthDate( bmonth, bday, byear )
//colon passes the rest of the arguments to functions in the "Date" functions, defined elsewhere, but declared in the Time class
My actual code looks like this:
Time::Time( int hr, int min, int sec, int bmonth, int bday, int byear ) { setTime( hr, min, sec ); } : birthDate( bmonth, bday, byear )
I tried every reasonable order between the three. Help!