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

后端 未结 7 979
猫巷女王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:07

    that's dummy statememt. You sample is identical to

    if (x == NULL) {
     // some code
     do_something_here();
    }
    
    /* empty (dummy statement) here */ ;
    
    // more code
    some_other_code_here();
    

提交回复
热议问题