Ch3.1: Empty
Statement Review
In C++, a statement ends with a semicolon. The simplest possible statement is just:
;
This is called an empty statement. It does nothing, but it is still valid.
Key takeaways
- Statements end with
;: every C++ statement must end with a semicolon. - Empty statement: a lone
;is a valid statement that does nothing. - Still meaningful: empty statements sometimes appear in loops or by accident.