Confusing

1
2
3
4
5
Time &Time::setTime(int h, int m, int s){

~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
}


why are there two Time class declaratoins?.. shouldnt it be written like this?

1
2
Time::&setTime(int h, int m, int s){
}
Last edited on
return_type scope::name(params);

Time &Time::setTime(int h, int m, int s) I, setTIme that belongs to the class Time, will return a reference to a Time object.
Last edited on
Right, like any other return type declaration. Thanks a bunch.
Topic archived. No new replies allowed.