i've been trying to store a coordinate in a vector array, and reading the coordinates from a .txt file.
there was no error, but the size of the vector is still 0 (i'm sure there was no value in the vector array)
here's my code:
#include <stdafx>
#include<iostream>
#include<fstream>
#include <stdio>
#include <vector>
using namespace std;
int main() {
ifstream myReadFile;
myReadFile.open("input test.txt");
vector<double> xVal,yVal;
int vectorSize = (int)xVal.size();
double x,y;
while (!myReadFile.eof()) {
myReadFile>>x>>y;
xVal.push_back(x);
yVal.push_back(y);
}
cout<<vectorSize<<endl;
myReadFile.close();
return 0;
}
any guide from the experts?