Input and Output
Most programs need to interact with their users, both to ask them what they want and to present the results when they are available. The computer term for this topic is I/O (short for “input/output”). We'll start by getting information from the keyboard and displaying it on the screen; later, we'll go over the more complex I/O functions that allow us to read and write data on the disk.
The program in Figure 3.20 displays the very informative text "This is a test and so is this.". The meaning of << is suggested by its arrowlike shape: The information on its right is sent to the “output target” on its left. In this case, we're sending the information to a predefined destination, cout, which stands for “character output”.[34] Characters ...
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