我收到错误 error:expected ':', ',' or')' before '.' token
在以下代码中:
#include<stdio.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
void filecopy(FILE*,FILE*);
int main()
{
FILE*fpin,*fpout;
fpin = fopen("file_a.dat", "r");//
fpout = fopen("file_b.dat", "w");
filecopy(fpin, fpout);
fclose ( fpin );
fclose ( fpout );
}
void filecopy(FILE*fpin.FILE*fpout)//(FILE*fpin,FILE*fpout)
{
char ch;
ch = getc (fpin);
while (!feof(fpin));//delete the ';'
{
putc (ch,fpout);
ch = getc (fpin);
}
}
PS:再次,我很抱歉我的仓促而无意义的问题。这要怪我粗心的编码习惯,不要再想了。我会注意在stackoverflow上提问。但我还是想对回答和评论的人表示感谢。
最佳答案
两个错误:
1.替换行:
while (!feof(fpin));
与:
while (!feof(fpin)) //without semicolon (;)
2.替换行:
void filecopy(FILE *fpin.FILE *fpout);
与:
void filecopy(FILE *fpin, FILE *fpout)
关于c - 错误 :expected ':' , ',' 或“)' before '”。代币,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42205812/