Cpp input/output
From wikinotes
<< // insert into stream
>> // receive from stream
std::cin >> my_string; // get input from stdin (terminates on space)
std::getline(cin, mystr) // get input from stdin (including spaces)
std::cout << my_string; // print string to stdout
std::cerr << my_string; // print string to stderr
std::clog << my_string; // print string to standard logging (through stream)
std::cout << "text" << std::endl;
std::cout << "This is a " << var << ". Isn't that great?"; //mix string-litterals with variables
printf("age %i", 30);
Note that if the user inputs incompatible data from cin, NO ERROR IS GENERATED. The information is silently ignored.