摘要:
#include <stdio.h>int main(){ char tmpname[L_tmpnam]; char *filename; FILE *tmpfp; filename=tmpnam(tmpname); printf("tmp file is : %s\n",filename); tmpfp=tmpfile(); if(tmpfp) printf("open a tmp file ok\n"); else ... 阅读全文
posted @ 2012-09-09 14:41
Dsp Tian
阅读(576)
评论(0)
推荐(0)
摘要:
#include <time.h>#include <stdio.h>int main(){ time_t the_time; (void)time(&the_time); printf("The date is: %s",ctime(&the_time)); return 0;}函数原型:#include <time.h>char *ctime(const time_t *timeval);注:上一篇获得的时间是标准格林威治时间。 阅读全文
posted @ 2012-09-09 14:21
Dsp Tian
阅读(488)
评论(0)
推荐(0)
摘要:
#include <time.h>#include <stdio.h>int main(){ struct tm *tm_ptr; time_t the_time; (void) time(&the_time); tm_ptr=gmtime(&the_time); printf("Raw time is %ld\n",the_time); printf("gmtime gives:\n"); printf("date: %02d/%02d/%02d\n", tm_ptr->tm_year, 阅读全文
posted @ 2012-09-09 14:09
Dsp Tian
阅读(477)
评论(0)
推荐(0)
摘要:
#include <time.h>#include <stdio.h>#include <unistd.h>int main(){ int i; time_t the_time; for(i=1;i<=5;i++) { the_time=time((time_t*)0); printf("the time is %ld\n",the_time); sleep(2); } exit(0);}时间是从1970年1月1日开始的。函数原型... 阅读全文
posted @ 2012-09-09 14:01
Dsp Tian
阅读(495)
评论(0)
推荐(0)

浙公网安备 33010602011771号