vector<vector<double> > vc;
//File to vector http://stackoverflow.com/a/23072197/6793751
string line;
ifstream fileStream(file);
while(getline(fileStream, line, '\n')) {
stringstream ss(line);
vector<double> numbers;
string in_line;
while(getline (ss, in_line, ',')) {
numbers.push_back(stod(in_line, 0));
}
vc.push_back(numbers);
}
/*TEST: GRADES FILE READ*/
// int rows=vc.size();
// for(int x=0; x<rows; ++x) {
// int cols=vc[x].size();
// for(int y=0; y<cols; ++y) {
// if(y<(cols-1)) printf(" %.1F, ",vc[x][y]);
// else(printf(" %.1F ",vc[x][y]));
// }
// cout<<endl;
// }
Comments