Textfile to textbox

Hi all
i am using this code to read a textfile

1
2
3
4
5
6
7
				 
#include <fstream>
using namespace std;
ifstream inFile;
inFile.open("C:/1.txt");
while (inFile >> age); 
inFile.close();

i don't want it to read the whole file i want it to read the second line and write it in textbox1
pls help me i am a really newbie in C++
I always used VB.NET
pls help
thanks in advance
is that file a column of integers?
anyway, a way to do this would be
1
2
3
4
5
file.ignore(numeric_limits<streamsize>::max, '\n');//skips a line

string str;
getline(file, str);//read a line into a string
//int a; file >> a; if you want an int 

or just repeat the reading part twice..
Topic archived. No new replies allowed.