G
Gary Wessle
Hi
I am not getting current time with this program, what am I doing
wrong?
#include <ctime>
#include <iostream>
using namespace std;
#define P(x) cout << #x " = " << (x) << "\n";
int main(){
time_t rawtime;
P( rawtime );
P( ctime(& rawtime) );
}
**************** output ****************
rawtime = 0
ctime(& rawtime) = Thu Jan 1 10:00:00 1970
I am not getting current time with this program, what am I doing
wrong?
#include <ctime>
#include <iostream>
using namespace std;
#define P(x) cout << #x " = " << (x) << "\n";
int main(){
time_t rawtime;
P( rawtime );
P( ctime(& rawtime) );
}
**************** output ****************
rawtime = 0
ctime(& rawtime) = Thu Jan 1 10:00:00 1970