December 2013
Beginner
656 pages
16h 42m
English
EXPLORATION 5
![]()
Simple Input
So far, the Explorations have focused on output. Now it’s time to turn your attention to input. Given that the output operator is <<, what do you expect the input operator to be? ________________
That didn’t take a rocket scientist to deduce, did it? The input operator is >>, the opposite direction of the output operator. Think of the operators as arrows pointing in the direction that information flows: from the stream to variables for input, or from variables to the stream for output.
Listing 5-1 shows a simple program that performs input and output.
Listing 5-1. Demonstrating Input and Output
#include <iostream> ...Read now
Unlock full access