user695652 user695652 - 1 month ago 20
C++ Question

Semicolon after Function

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

void foo() {

};

Answer

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() {

};;;;;;;;
Comments