I have two text files:
17204 600 0 0 0 0 0 0 0
16530 600 0 0 0 0 0 0 0
28121 600 0 0 0 0 0 0 0
94199 600 0 885 168 0 0 10 1063
217147 7500 0 10521 1854 0 38 637 13050
445410 7500 0 25488 7938 0 303 1425 35154
696854 7500 0 39942 11757 0 353 2966 55018
735945 7500 0 40557 11649 360 381 2250 55197
570434 7500 0 23148 10044 617 249 984 35042
412416 6000 0 12270 3219 0 0 291 15780
55022 600 0 0 0 0 0 0 0
14111 600 0 0 0 0 0 0 0
and:
January February March April May June July August September October November December
I need to create a table like this:
January 17204 600 0 0 0 0 0 0 0
February 16530 600 0 0 0 0 0 0 0
March 28121 600 0 0 0 0 0 0 0
April 94199 600 0 885 168 0 0 10 1063
May 217147 7500 0 10521 1854 0 38 637 13050
June 445410 7500 0 25488 7938 0 303 1425 35154
July 696854 7500 0 39942 11757 0 353 2966 55018
August 735945 7500 0 40557 11649 360 381 2250 55197
September 570434 7500 0 23148 10044 617 249 984 35042
October 412416 6000 0 12270 3219 0 0 291 15780
November 55022 600 0 0 0 0 0 0 0
December 14111 600 0 0 0 0 0 0 0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
int table1[ROWS][COLS];
string table2[ROWS];
int choice,
count,
index;
string monthNames;
ifstream inputFile1;
ifstream inputFile2;
inputFile1.open("visitors.txt");
if (!inputFile1.is_open()) return -1;
for (count = 0; count < ROWS; count++)
{
for (index = 0; index < COLS; index++)
inputFile1 >> table1[ROWS][COLS];
}
inputFile1.close();
inputFile2.open("months.txt");
if (!inputFile2.is_open()) return -1;
for (count = 0; count < ROWS; count++)
{
inputFile2 >> table2[ROWS];
}
inputFile2.close();
|
There are more parts to the program, but I need help getting the values into an array (or vector)