The cout Statement, Word by Word

The cout statement is what actually displays the program result on the screen or window. It is a special object from the iostream library.

The << symbol (two less-than signs) is an inserter, which takes whatever follows it and gives it to the cout object. Here you can see a little hint of what object-oriented programming is like.

What follows the inserter is a literal (as in “take this literally”). In this case, it is a string literal—a string of characters that consists of everything between the quotation marks.

The second inserter tacks an “end of line” (endl) on the end of the string literal display so that if anything further is displayed it will start on its own line. Different operating systems use different ...

Get SAMS Teach Yourself C++ in 10 Minutes SECOND EDITION now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.