Hi
I use the following piece of code to load a bunch of doubles into my vector:
However, my compiler says that getline is "an undeclared identifier". Isn't that what iostream is supposed to contain?Code:#include <iostream> #include <fstream> #include <vector> ... std::vector<double> velX; double velTemp; std::ifstream vX("vX.txt"); if(vX.is_open()) { while(!vX.eof()) { getline(vX, velTemp); velX.push_back(velTemp); } vX.close(); } else { cout << "Unable to open file." << endl; }
Best,
Niels.