Read data from my .txt?
I wanna make a program that can easily read data from my document!
If I have a .txt with these values
I want to use it as a database...
ABC 1 2 3
DEF 4 5 6
GHI 7 8 9
But how do I make a function that reads data from a specific line and pulls out the numbers behind and gives them all names like
Name = "DEF";
Value1 = 4;
Value2 = 5;
Value3 = 6;
The thign I need is that that I can type in, I want the data from line 10 and then the program takes the data and puts in into my variables
I want to use fstream btw... Iam just not very good at streams atm...
...in its simplest form. May need some tweaking/error testing though.
File >> Entry.Name >> Entry.Value1 >> Entry.Value2 >> Entry.Value3;
So you are storing the data in a vector? Which I can then take the data from?
Ahem - eof in a control loop FAQ ?