|
my program:
[code:1]
#include <time.h>
#include <unistd.h>
int main()
{
time_t timep;
time (&timep);
printf("use asctime(gmtime(&timep)): %s\n", asctime(gmtime(&timep)));
printf("use ctime(&timep): %s timep is a varible of time_t. \n",ctime(&timep));
struct timevar tv;
struct timezone tz;
gettimeofday(&tv, &tz);
printf("tv_sec is %d\n", tv.tv_sec);
printf("tv_usec is %d\n", tv.tv_usec);
printf("tz_miniuteswest is %d\n", tz.tz_miniuteswest);
printf("tz_dsttime is %d\n", tz.tz_dsttime);
return 1;
}[/code:1]
use : gcc -o testtime testtime.c
compile error message:
testtime.c: In function `main':
testtime.c:13: storage size of `tv' isn't known
testtime.c:14: storage size of `tz' isn't known |
|