Chinaunix首页 | 论坛 | 博客
  • 博客访问: 222275
  • 博文数量: 48
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 412
  • 用 户 组: 普通用户
  • 注册时间: 2013-04-24 10:27
个人简介

Continuous pursuit technical details

文章分类

全部博文(48)

文章存档

2014年(1)

2013年(47)

分类: C/C++

2013-12-10 15:17:12

       #include
       #include
       #include


       int
       main(int argc, char *argv[])
       {
           char outstr[200];
           time_t t;
           struct tm *tmp;


           t = time(NULL);
           tmp = localtime(&t);
           if (tmp == NULL) {
               perror("localtime");
               exit(EXIT_FAILURE);
           }


           if (strftime(outstr, sizeof(outstr), argv[1], tmp) == 0) {
               fprintf(stderr, "strftime returned 0");
               exit(EXIT_FAILURE);
           }


           printf("Result string is \"%s\"\n", outstr);
           exit(EXIT_SUCCESS);
       } /* main */

阅读(1411) | 评论(0) | 转发(0) |
0

上一篇:select-client.c

下一篇:malloc_stat.cpp

给主人留下些什么吧!~~