want a suggestion

I had problem with my program. I have text file and I want char inside it to be keep in 2d array

example in text file has
"INSIDE
OUTSIDE
EXAMPLE"

I want them kept in "char keep[][]"

any can suggest me how can do it

sorry for my bad English and thank in advance!

Noob programer
Why char arrays? Why not just use strings?

1
2
3
4
5
6
7
8
9
ifstream file( "yourfile.txt" );
string data[3];

for(int i = 0; i < 3; ++i)
  getline( file, data[i] );

cout << data[0] << endl;  // "INSIDE"
cout << data[1] << endl;  // "OUTSIDE"
cout << data[2] << endl;  // "EXAMPLE" 
Thank for your help!
Topic archived. No new replies allowed.