O'Reilly logo

Sams Teach Yourself C++ in 24 Hours, fifth edition by Rogers Cadenhead, Jesse Liberty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hour 4. Using Expressions, Statements, and Operators

Statements

All C++ programs are made up of statements, which are commands that end with a semicolon. Each statement takes up one line by convention, but this is not a requirement—multiple statements could be put on a line as long as each ends with a semicolon. A statement controls the program’s sequence of execution, evaluates an expression, or can even do nothing (the null statement). A common statement is an assignment:

x = a + b;

This statement assigns the variable x to equal the sum of a + b. The assignment operator ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required