Semicolon at the ends of if-statements and functions in C

后端 未结 7 954
猫巷女王i
猫巷女王i 2020-12-20 11:11

I just ran into some code that overuse semicolons, or use semicolon for different purposes that I am not aware of.

I found semicolons at the end of if-statements and

7条回答
  •  暖寄归人
    2020-12-20 12:10

    I think that the author may have been going for something like:

    if(condition for tbd block)
        ;
    else {
        //Some code here
    }
    

    which you might do if you were scaffolding code and still wanted it to compile. There's a good chance that it's just an error as Jon suggests though.

提交回复
热议问题