BBS水木清华站∶精华区
发信人: kxn (烤小牛~信号没糊系统糊了!), 信区: Linux
标 题: Re: time函数怎么调用啊?
发信站: BBS 水木清华站 (Fri Jan 14 21:53:41 2000)
【 在 cybergene (活泼的基因) 的大作中提到: 】
∶ 程序改成
∶ #include <time.h>
∶ int main()
∶ {
∶ time_t tt;
∶ struct tm *aa;
∶ char *dd;
char dd[100]; // 要给指针分配空间的说
∶ size_t aaa;
∶ aaa=10;
∶ time(&tt);
∶ aa=gmtime(&tt);
∶ strftime(dd,aaa,"%Y-%m-%d",aa);
∶ printf("%s\n\n",dd);
∶ exit(0);
∶ }
∶ 编译运行还是bash: ./othertest: Permission denied
∶ 对了,kxn大侠知道有什么其它的方法得到我上面程序中的dd字符串么?:-)
--
※ 来源:·BBS 水木清华站 smth.org·[FROM: 166.111.136.178]
BBS水木清华站∶精华区