Section 2.2 First Program in C++: Printing a Line of Text

  • Single-line comments (p. 46) begin with //. You insert comments to document your programs and improve their readability.

  • Comments do not cause the computer to perform any action (p. 47) when the program is run— they’re ignored by the compiler.

  • A preprocessing directive (p. 46) begins with # and is a message to the C++ preprocessor. Preprocessing directives are processed before the program is compiled.

  • The line #include <iostream> (p. 46) tells the C++ preprocessor to include the contents of the input/output stream header, which contains information necessary to compile programs that output data to the screen or input data from the keyboard.

  • White space (i.e., blank lines, ...

Get C++ How to Program, 10/e 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.