Semicolon after Function

后端 未结 6 1504
广开言路
广开言路 2021-02-18 12:57

Is there a specific reason why some people put a semicolon after the curly closing function bracket?

void foo() {

};
6条回答
  •  庸人自扰
    2021-02-18 13:28

    Not really, the semicolon there makes no difference. It's probably a matter of habit.

    You can put as many semicolons if you want though in C++11:

    void foo() {
    
    };;;;;;;;
    

提交回复
热议问题