std::string _str; _file.seekg(std::ios::beg); while(!_file.eof()) { if(_file.good()) { // read single chars std::string _buf; std::getline(_file, _buf); _str += (_buf); } };