#include
#include
#include
int main () /*C程序的主函数,开始入口*/
{
struct stat buf;
stat("/etc/passwd",&buf);
printf("“/etc/passwd”文件的大小是:%d\n",buf.st_size);
return 0;
}
编译出现下面的问题,但新手表示不明白,求教:
4-4.c: In function ‘main’:
4-4.c:9:1: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘__off_t’
jayee 于 2011-07-18 01:39:50发表:
2# whatot
解决了,应该是以%ld输出
whatot 于 2011-07-18 01:00:10发表:
输出不应该是%d吧