为什么得到的程序开始运行时刻与结束运行时刻是相同的?

我用
time_t rawtime; 
struct tm * timeinfo; 
time ( &rawtime ); 
timeinfo = localtime ( &rawtime ); 
printf("程序运行开始,Currentlocal time and date: %s\n", asctime(timeinfo));
……
printf("程序运行结束,Currentlocal time and date: %s", asctime(timeinfo));

不负相思意
浏览 79回答 1
1回答

胡子哥哥

这样干,你少写了两行time_t rawtime; struct tm * timeinfo; time ( &rawtime ); timeinfo = localtime ( &rawtime ); printf("程序运行开始,Currentlocal time and date: %s\n", asctime(timeinfo));……time ( &rawtime ); timeinfo = localtime ( &rawtime );printf("程序运行结束,Currentlocal time and date: %s", asctime(timeinfo));
打开App,查看更多内容
随时随地看视频慕课网APP