这是我的代码
#include<stdio.h>
int main( int argc ,char *argv[] )
{
FILE *fp;
void filecopy( FILE * a, FILE *b )
if (argc == 1)
{
filecopy(stdin,stdout);
}
else
{
while(--argc > 0)
{
if ((fp = fopen(*++argv,"r")) == NULL)
{
printf("no open".*argv);
}
else
{
filecopy(fp,stdout);
fclose(fp);
}
}
}
return 0;
}
void filecopy ( FILE *ifp ,FILE *ofp )
{
int c;
while ( (c = getc(ifp)) != EOF)
{
putc(c , ofp);
}
}
这些是我的错误:
con.c: In function 'filecopy':
con.c:8: error: expected declaration specifiers before 'if'
con.c:13: error: expected declaration specifiers before 'else'
con.c:29: error: expected declaration specifiers before 'return'
con.c:30: error: expected declaration specifiers before '}' token
con.c:33: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
con.c:39: error: expected '{' at end of input
con.c: In function 'main':
con.c:39: error: expected declaration or statement at end of input
为什么我收到这些错误请告诉我?谢谢苏丹舒