半吊子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
贴吧用户_0aX3aA7128
ctime 返回是 char *?
2013年01月23日 05点01分
4
whatofor
是. 我还专门查了的.
2013年01月23日 05点01分
贴吧用户_0aX3aA7128
你没先 time(tim) 吧。
2013年01月23日 05点01分
whatofor
回复 乐天派的小耗子 :额. 刚写上来漏了. 不过这个原因影响不大.
2013年01月23日 05点01分
level 3
梁右成诗者成X
果然半吊子…………啥也不说了
2013年01月23日 05点01分
6
level 12
💫娜迦女妖
2013年01月23日 06点01分
7
whatofor
...
2013年01月23日 06点01分
我变成鱼了
delphi大神
2013年01月23日 10点01分
level 3
深笑深笑
啥也没看懂
2013年01月23日 10点01分
9
1