Someone
public text v1 · immutable#include <iostream>
#include <time.h>
using std::cout;
using std::endl;
class Time {
public:
Time();
void printTime();
void setTime();
private:
time_t value;
};
Time::Time()
{
setTime();
}
void Time::setTime()
{
value=time(NULL);
}
void Time::printTime()
{
cout << "Current time is: " << value << endl;
}
int main()
{
Time t;
t.printTime();
return 0;
}