STL and reading lines
Tuesday, July 31st, 2007For no good reason other than I just used this code once again, and once again marvelled at the almost script-like qualities STL-laden C++ has, here is the easy recipe for reading each line of a text file into a string (assume correct includes and using namespace std). string line; ifstream infile( "/etc/hosts" ); while( [...]