O'Reilly logo

SAMS Teach Yourself C++ in 10 Minutes SECOND EDITION by Jesse Liberty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required