您的位置:首页 > 其它

OTR-记一个关于参数传递的问题.

2012-06-11 18:37 211 查看
What I write, what I lost.


#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <libio.h>
#include <unistd.h>
#include <math.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
//#include <sys/time.h>
#include <pthread.h>

int test();

int main()
{
test();
printf("\n");
test();
printf("\n");

return 0;
}

int test()
{
struct timeval tmp_t;
gettimeofday(&tmp_t);
int ret = tmp_t.tv_sec;
return ret;
}


编译的时候忽略警告.
执行发现程序会不能正常退出.
这个可能跟gettimeofday的第二个参数相关. 解释不能.

谢谢.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: