You pass sometime
by value, not by reference, so that it remains uninitialized. Change GetTime
to the following:
void GetTime( Time ** &sometime )
Since you are creating an array of pointers, you can use array notation to access them while printing. A.
std::cout << " Print times " << _time[i]->hour << " hour " << _time[i]->minute << " minutes " << std::endl;
source share