In article <Exupj.6292$qI.4067@trnddc03>,
Bill Cunningham <> wrote:
> My compiler gives me a syntax error on line 13 and I don't see. Here's
>the code.
>#include <stdio.h>
>
>
>int chunk (char *n1, char *n2, int bs, int nb);
>main(){
> int chunk (char *n1, char *n2, int bs, int nb)
> {FILE *fp;
> fp=fopen(n1,"rb");
> fread(n1,bs,sizeof(nb),fp);
> fclose(fp);
> fp=fopen(n2,"wb");
> fwrite(n2,bs,sizeof(nb),fp);
> fclose(fp);}
You are missing a }. You have an open { from the main() line,
and you have an open { from the int chunk line that is inside main.
Unless you are using gcc or another compiler with a similar extension,
it is not allowed to define nested functions, so it would not be valid
to have int chunk() { inside of the definition of main.
You must be using a C90 compiler, as otherwise you would not be able
to use the implicit int return result for your definition of main(),
and yet you do not return any value within the body of main.
--
This is a Usenet signature block. Please do not quote it when replying
to one of my postings.
http://en.wikipedia.org/wiki/Signature_block