0

I have a 2D array of characters forming a word that is to be parallel with an array of ints. How can i properly change this code so it prints out the correct numbers of letter with no junk and keeps each int parallel to the char array. Each name in the char array has different lengths of their respective name. All of the data has been read into the array. This is my current code.

for (int count = 0; count < rows; count++)
        {
            for(int i = 0; i < COLS; i++)
            {
                cout << array[count][i];

            }
            cout << scores[count] << endl;
        }

And here is the data in my file

Jaquars 23    
Colts 23
Niners 13
Lions 13
Titans 7
Redskins 38
Cardinals 14
Buccaneers 36
Seahawks 30
Lions 24
Bears 28
Packers 23
Bears 14
Rams 22
Texans 6
Packers 34
Yu Hao
  • 119,891
  • 44
  • 235
  • 294

0 Answers0