Stdio and Streams

std::getline

std::string line;
std::getlinecin, line;

Note that getline also works for other input streams, such as cout and cerr

stdout

stdin

cin

std::string foo, bar;
std::cin >> foo >> bar;

grabs the next two "words" or strings from stdin which are separated by a whitespace character.

Variable Length Input

Options:

File Streams

To use, #include <fstream>

Then we can do something like myFileStream >> "hello!"