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

后端 未结 7 940
猫巷女王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 11:56

    These semicolons are not needed (as you said, they are empty statements). Your code compiles with gcc, providing that 'x' is defined (check http://www.codepad.org). There's no reason why a C compiler would refuse to compile your code.

提交回复
热议问题