So far we have learnt how to use std::cout and print to the screen.
You can store keyboard input into a local variable using cin (pronounced c-in).
cin >> i;
>> is a two character operator.
The stream I/O library takes care of parsing the input and storing it in the variable.
- Type rules still apply.
With this we have learnt -
- How to read from keyboard and write to screen using STL.
- Variables and Expressions in C++ have types.
Please leave out comments with anything you don't understand or would like for me to improve upon.
Thanks for reading!