Chapter 2. Functions and Control Statements
In Chapter 1, “Expressions and Variables,” you learned about C++ expressions and the most important operators used in expressions. In addition, you learned how to manipulate character strings, display values, and write to disk files. So far we have not been programming. Programming involves making decisions and repeating operations; the building blocks of programs are functions and control statements. A C++ program consists of one or more files that contain statements (which are its sentences) organized into functions (which are the equivalent of paragraphs). For instance, a program to calculate the average value of some numbers would have to repeatedly get a value, add it to the sum, until there were ...
Get C++ By Example: UnderC Learning 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.