Error - Expected identifier or '('


#1

Good evening,
I’m doing the recursion activity, about the annoying Beer Song. I have typed in the code from the book correctly (as far as I can tell), but i keep getting an error on the 4th to last line saying “expected identifier or ‘(’” on the ‘{’. WHy is this? It is correctly matched up with another bracket.

#include <stdio.h>
void singTheSong(int numberOfBottles)
{
if (numberOfBottles == 0) {
printf(“There are simply no more bottles of beer on the wall.\n”);
} else {
printf("%d bottles off beer on the wall. %d bottles of beer.\n",
numberOfBottles, numberOfBottles);
int oneFewer = numberOfBottles - 1;
printf(“Take on down, pass it around, %d bottles of beer on the wall.\n”,
oneFewer);
singTheSong(oneFewer); //This function calls itself
printf(“Put a bottle in the recycling, %d empty bottles in the bin.\n”,
numberOfBottles);
}
}

int main(int argc, const char * argv[]);
{
singTheSong(99);
return 0;
}


#2

Get rid of the semicolon after the definition of the main method. That should only be there when declaring a method or function, not when defining it.


#3

Thanks, bro, couldn’t find it haha