C语言 C: 错误:在 ';' 之前应为 ')' 令牌

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15230860/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 05:34:18  来源:igfitidea点击:

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

c

提问by ahota

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

当我注释掉该行时,它编译得很好

回答by nos

Your code has something like this:

你的代码是这样的:

#define LOOP_LIMIT 10;
                     ^
                    Remove this semicolon.