I have this class declaration that should set hour, minute and second variables within my Time class:
class Time
{
public:
int hour; //0-23
int minute; //0-59
int second; //0-59
};
Now, This next code should work for that class definition:
Time clock;
Time *clockPtr = &clock;
clock.hour=8;
clock.minute=12;
*clockPtr.second=0;
Will this work? I think that because the pointer is pointing to the value of the address &clock it should work. Correct me if I am wrong please.