-2

At the very beggining of my main method I have

main(int argc, char *argv[]){
if(argc!=2){
   printf("not enough arguments");
   exit(-1);
}
/* rest of code */
}

But compiling with cc prints

line 11 } missing before int
line 12 argv undefined
line 14 for deleted
line 21 identifier missing before type_identifier
line 26 ; missing before {

If i remove that if, errors are gone.

FoxeyYy
  • 1
  • 1

2 Answers2

1
int main(int argc, char *argv[]) {
if(argc!=2){
   printf("not enough arguments");
   exit(-1);
}
/* rest of code */
}
triclosan
  • 5,578
  • 6
  • 26
  • 50
0

You are missing closing ) for the main function args main(int argc, char *argv[]) ...

Martin Macak
  • 3,507
  • 2
  • 30
  • 54