I wanted to use fstream to read a txt file.
fstream
I am using inFile >> characterToConvert, but the problem is that this omits any spaces an
inFile >> characterToConvert
std::ifstream ifs( "filename.txt" ); std::string str( ( std::istreambuf_iterator( ifs ) ), std::istreambuf_iterator() );