C++ TutorialLesson 8Free preview
C++ User Input
This lesson is part of C++ · All levels
Summary
This lesson teaches you how to make a program receive data from a user via a keyboard. The ring object of the iostream header is used along with the operator >> to read values into the variable. So the program is no longer static and can respond to user input.
Key points
- The cin is used to read input from the standard input (keyboard).
- The operator >> directs the data from the input to the variable.
- The variable must be declared before receiving a value from the ring.
- Some inputs can be read in sequence in a single sentence.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.