1234567891011
#include <string> #include <fstream> // ... std::ifstream ifs("myfile.txt"); std::string word; // extract one word ignoring leading spaces and stopping at the next space ifs >> word;