Hey guys I'm reading a file into a two dimensional array that look like this:
2 2 2 2 2
2 2 2 2 2
234 234 234 234 2.32323e+006
22222 2 2 2 2
Dilmer Valecillos ComputerScience 02/04/3008 323.009
2 22 2 2 2
My problem is when displaying the info in the program I want to specify every row with a number
1. 2 2 2 2 2
2. 2 2 2 2 2
3. 234 234 234 234 2.32323e+006
4. 22222 2 2 2 2
5. Dilmer Valecillos ComputerScience 02/04/3008 323.009
6. 2 22 2 2 2
This is My code so far
Code:system("cls"); string Engine[NROWS][NCOLS]; ifstream inFile; inFile.open("Engineer.dat"); cout << " View ...\n" << endl; ///////////////Read data in file////////////////////// for ( int i = 0 ; i <= NROWS -1; i++) { for ( int j = 0; j <= NCOLS-1; j++) { inFile >> Engine [i] [j]; } } ///////////////Print Data in file////////////////////// for ( i = 0 ; i <= NROWS -1; i++) { for ( int j = 0; j <= NCOLS -1 ; j++) { cout << " " << Engine [i][j]; } cout << endl; //I want to have a new //line after the end of the las word could I do that? } inFile.close(); system ("pause");



LinkBack URL
About LinkBacks


