Summary

A C++ program consists of one or more modules called functions. Programs begin executing at the beginning of the function called main() (all lowercase), so you always should have a function by this name. A function, in turn, consists of a heading and a body. The function heading tells you what kind of return value, if any, the function produces and what sort of information it expects to be passed to it by arguments. The function body consists of a series of C++ statements enclosed in paired braces: {}.

C++ statement types include declaration statements, assignment statements, function call statements, object message statements, and return statements. The declaration statement announces the name of a variable and establishes the type of ...

Get C++ Primer Plus, Fourth 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.