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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access