找回密码
 注册
查看: 1190|回复: 3

请教: void value not ignore.....

[复制链接]
发表于 2005-8-18 12:56:44 | 显示全部楼层 |阅读模式
用GCC编译出现如下错误:
test9.c:17: void value not ignored as it ought to be

程序是关于流的IO操作,代码如下:
........
FILE *stream;
if((stream=fopen("test","r"))==(FILE*)0)
{
fprintf(stderr,"error opening file.\n");
exit(1);
}
if((setlinebuf(stream))!=0)  //出错误的行
{
fprintf(stderr,"error setlinebuffer.\n");
exit(1)
}
..........

出错的意思好像是说setlinebuf不该加参数stream?弄不明白.....
请各位指点迷津!!
发表于 2005-8-18 13:56:04 | 显示全部楼层
setlinebuf的返回值是void吧
回复

使用道具 举报

发表于 2005-8-18 16:58:38 | 显示全部楼层
void setlinebuf(FILE *stream);
看看setvbuf!
回复

使用道具 举报

 楼主| 发表于 2005-8-28 08:43:45 | 显示全部楼层
搞定,谢谢
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2025-2-7 23:59 , Processed in 0.026287 second(s), 16 queries .

© 2001-2025 Discuz! Team. Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表