My quick solution:


void readCSV(const string &filename, vector< vector<string> > &filecontents)
{
ifstream in(filename.c_str());
string line;
vector<string> valrow;

...