1 error generated. $ clang cash.c cash.c:6:1: error: expected identifier or '('

my code starts like this

#include <stdio.h>
#include <math.h>

int main (void);
float dollar;
the rest of all my code...

please advise me on what to do Ive been stuck for 3 days!


Two problems: the semicolon after main() and the placement of the curly braces. The structure of a program should look like this:

#include...  //includes first

int main(void)    //note no semicolon here
{      // nothing between the main declaration line and the opening curly brace.

    // program code goes here

}    // closing curly brace to end main.

Any questions? If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .