#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
내가 왜 이러한 오류가 제발 말해 무엇입니까? 이 함수 프로토 타입이기 때문에
void filecopy(FILE * a, FILE *b)
이
void filecopy(FILE * a, FILE *b);
해야한다 : 당신에게
'열려 있지 않음'. * argv'이란 무엇입니까? –
실제로 미안하지만 ("no open", * argv); –