C: fout: verwacht ‘)’ voor ‘;’ token

Dit lijkt de eenvoudigste code, maar ik weet niet waarom het niet compileert:

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

wanneer ik commentaar geef op de regel, compileert het prima


Antwoord 1, autoriteit 100%

Uw code heeft zoiets als dit:

#define LOOP_LIMIT 10;
                     ^
                    Remove this semicolon.

Other episodes