半吊子c++程序员写的c代码.
c++吧
全部回复
仅看楼主
level 11
whatofor 楼主
[拍砖]#include <stdio.h>
#include <unistd.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/stat.h>
int main(){
time_t tim;
printf("%s", ctime(&tim));
return 0;
}
2013年01月23日 05点01分 1
level 11
whatofor 楼主
[打酱油]$gcc a.c $./a.out
Segmentation fault
//半小多时的时间就这么没了.
2013年01月23日 05点01分 3
level 12
ctime 返回是 char *?
2013年01月23日 05点01分 4
是. 我还专门查了的.
2013年01月23日 05点01分
你没先 time(tim) 吧。
2013年01月23日 05点01分
回复 乐天派的小耗子 :额. 刚写上来漏了. 不过这个原因影响不大.
2013年01月23日 05点01分
level 3
果然半吊子…………啥也不说了
2013年01月23日 05点01分 6
level 12
[拜]
2013年01月23日 06点01分 7
...
2013年01月23日 06点01分
delphi大神
2013年01月23日 10点01分
level 3
啥也没看懂
2013年01月23日 10点01分 9
1