std::cout
is short for standard character output.
#include <iostream>
int main() {
std::cout << 42;
}
<<
) to output values.std::endl
at the end of a std::cout
statement to signal a newline.std::cout << "Hello" << std::endl << "I am a teacher.";
Hello
I am a teacher.
std::cin
stands for standard character input.
#include <iostream>
int main() {
int age;
std::cin >> age;
std::cout << "You entered: " << age << std::endl;
}
std::cin >> age >> gender;
std::cout
, manage new lines with std::endl
, and take input with std::cin
.End of lecture. Thank you for watching. See you in the next one!