Statements

A statement controls the sequence of execution, evaluates an expression, or does nothing (the null statement). All C++ statements end with a semicolon.

A common simple statement is the assignment:

x = a + b;

Unlike in algebra, this statement does not mean that x equals a+b. This is read, “Assign the value of the sum of a and b to x,” or “Assign to x, a+b.” Even though this statement is doing two things, it is one statement and, therefore, has one semicolon. The assignment operator assigns whatever is on the right side to whatever is on the left side.

Whitespace

Spaces, along with tabs and new lines, are called whitespace. Extra whitespace ...

Get Sams Teach Yourself C++ in 24 Hours, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.