csv-file save into a 2dimensional-array

hello everyone
I'm trying to write a csv file and save the values into a 2dimensional-array.
In the csv-file is: ruedi;200;
hans;700;
peter;390;
bob;550;
hubert;399;
but when I print out the array, it prints like that:
200
hans
ruedi
390
bob
700
peter
399

550
hubert
I think it saves the values wrong, can anybody help me?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  ifstream file ( "highscore.csv" );
    while(file.good()){

         getline ( file, value, ';' );
         player[i][0] = string( value, 0, value.length() );

         getline ( file, value, ';' );
         player[i][1] = string( value, 0, value.length() );
         i++;
        }

    for(i=0; i<5; i++){

            cout << player[i][1] << endl;
            cout << player[i][0] << endl;
    }
What makes you think it's saving it wrong? What output are you expecting?
Topic archived. No new replies allowed.