Variables
The input counterpart to std::cout
is std::cin
. We use std::cin
with the >>
operator to receive input for the program.
This line creates an empty std::string
variable called name
:
std::string name{};
This line takes an input word and set it to name
:
std::cin >> name;
Make the program receive name
as an input.
name
with std::string name{};
.name
with std::cin >> name;
.