cppforever.com

Statements and semicolons

Each statement must end with a semicolon ;.

In C and C++ ; is the terminator, not a separator.

Example:

int x = 10;   // correct
int x = 10    // missing semicolon → compilation error

Advantages: This requirement makes C++ syntax more precise and avoids ambiguity.

The compiler does not infer statement boundaries from line breaks — only from semicolons and braces.