16

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

5
  • 3
    Where/How is LOOP_LIMIT defined?
    – md5
    Commented Mar 5, 2013 at 18:01
  • 1
    what is LOOP_LIMIT?
    – Wrikken
    Commented Mar 5, 2013 at 18:01
  • 1
    Following the guidelines here would help everyone answer your query: sscce.org
    – Bill Lynch
    Commented Mar 5, 2013 at 18:01
  • is LOOP_LIMIT a macro ? if then, how it is defined ?
    – A4L
    Commented Mar 5, 2013 at 18:02
  • you may at least consider providing what errors you got?
    – cipher
    Commented Mar 5, 2013 at 18:15

1 Answer 1

53

Your code has something like this:

#define LOOP_LIMIT 10;
                     ^
                    Remove this semicolon.
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.