Conteúdo do Curso
Introduction to C++ | Mobile-Friendly
Introduction to C++ | Mobile-Friendly
User Input
We already know how to output the data with the object cout
and operator <<
. However, sometimes we need to get values directly from the user. To enable this operation use cin
in combination with the extraction operator >>
.
For example, here we want to get the value for the variable a and output it:
In the line #12 the user print the value which will be stored in the variable a
.
Obrigado pelo seu feedback!