Austin Gayler
Austin Gayler

Reputation: 4356

C: error: expected ')' before ';' token

This seems like the simplest code, but I don't know why it won't compile:

    switch(choice) {
        case 0:
            printf("%d", LOOP_LIMIT); /* this line gives the error */
            break;
        case 1:

when I comment out the line it compiles fine

Upvotes: 16

Views: 92271

Answers (1)

nos
nos

Reputation: 229058

Your code has something like this:

#define LOOP_LIMIT 10;
                     ^
                    Remove this semicolon.

Upvotes: 53

Related Questions