Hello,
I am writing a program that will read each line of a file into a vector of
vectors. This data will then be analysed. Here is what i have done:
typedef vector<string> lines;
...
vector<lines> SourceVector;
string one_line;
while (getline(inFile, one_line, '\n'))
{
vector<string> text;
text.push_back(one_line);
SourceVector.push_back(text);
cout << " " << endl;
cout << one_line << endl;
}
all this does, is it reads each line into a vector. I want it to read each
'data' of the line into an element of the vector. so, if my file is:
A 0.2 0.4 0.5
B 0.6 0.7 0.9
then 'A' will be in index 0, '0.2' will be in index 1 and so on...
'B' will be in index 0 of another vector etc.
can someone please help me? how can i do this?
any help given would be greatly appreciated.
Thanx!