Originally Posted by
mikeman118
BTW, if you think I should just give this up and do something else, just tell me. All I really need to know is how to read an entire text file.
STL can be powerful:
Code:
#include <algorithm>
#include <iterator>
#include <iostream>
using namespace std;
string file_data;
cin >> noskipws;
// Read entire file using a single line of code
copy(istream_iterator<char>(cin), istream_iterator<char>(), back_inserter(file_data));
I wrote "using namespace std" to reduce verbosity, not because I necessarily think it's good :-)