-5

I get the error error:expected ':', ',' or')' before '.' token in the following code:

#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:Again,I'm sorry for my hasty and meaningless question.It was blame for my careless coding habit ,and don't think it over.I'll pay attention to asking question on stackoverflow.But I stil want to say thanks to the people who had answered and commented.

Ghoster
  • 75
  • 10

2 Answers2

4

Two mistakes :

1. Replace line :

while (!feof(fpin));

with :

while (!feof(fpin))       //without semicolon (;)

2. Replace line :

void filecopy(FILE *fpin.FILE *fpout);

with :

void filecopy(FILE *fpin, FILE *fpout)
Marievi
  • 4,951
  • 1
  • 16
  • 33
2

In line 19 you have separated function arguments with dot instead of comma.

lukeg
  • 4,189
  • 3
  • 19
  • 40