当前位置: 技术问答>linux和unix
请教一个错误:void value not ignored as it ought to be
来源: 互联网 发布时间:2015-10-16
本文导语: 用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...
用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?弄不明白.....
请各位指点迷津!!
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?弄不明白.....
请各位指点迷津!!
|
setlinebuf好像没有返回值
|
对!没有返回值。返回类型是void