using array to get data from txt file

Hi,I wanted to extract values from a txt file into an array in a program. my txt file is:

14 8 0.4 16 2.0 1.7
16 10 0.5 17 2.2 1.8
18 11 0.5 18 2.2 2.0
20 12 0.5 19 2.4 2.2
22 13 0.5 20 2.5 2.4
24 14 0.5 21 2.6 2.5
27 16 0.6 22 2.6 2.8
30 18 0.6 23 2.7 3.0
35 21 0.6 25 2.8 3.4
40 24 0.6 26 2.9 3.8
45 27 0.6 27 3.1 3.8
50 30 0.6 29 3.2 3.8

I would like to ask the user to input a value for example A1 (this would correspond to the first row of numbers in the txt file), and I would like program to output something like:
"You have selected A1.
strength is 14
length is 8
width is 0.4
height is 16
weight is 2
price is 1.7"

And the same if another value is inputted by user (i.e A2 would correspond to row 2). Is this possible to do?

I'm using microsoft visual studio 2010. Please help! I'm very new to C++
what is the A for if all you use in A1,A2,... is the number?

what you need is this http://www.cplusplus.com/doc/tutorial/files/
and this http://www.cplusplus.com/doc/tutorial/control/

if you know the lines number just repeat getline and drop it until you reach the line you actualle want to read
A1 corresponds to the type of material that the user has selected.
I'm not allowed to use getline for my project, and ive been told it doesnt work for a win.32 console project (is this true?). Is there any other alternative?
getline doesnt work for a win.32 console project

bullshit
my module leader wont allow that in my project anyway. Is there an alternative?
">>"
sorry if i sound stupid, literally started using C++ a few weeks ago. Still only starting to understand the language now, really need some help on how to use array to get data out of a .txt file please?
Topic archived. No new replies allowed.