// Mr. Minich
// CMPSC 201
// Ch. 11 Demo Program #7
// January 20, 2000
// Purpose - neatly displaying a two-dimensional array
#include <iostream>
using namespace std;
void displayMatrix(int incArray[][3]);
int main()
{
int matrix[3][3] = {0};
int row = 0;
int col = 0;
ifstream infile;
infile.open("sequentialAccessFile.txt");
for (row = 0; row <= 2; row++)
{
for (col = 0; col <= 2; col++)
{
infile >> matrix[row][col];
}
}
displayMatrix(matrix);
return 0;
}// end of main
void displayMatrix(int incArray[][3])
{
int row = 0;
int col = 0;
for (row = 0; row <= 2; row++)
{
for (col = 0; col <= 2; col++)
{
cout << incArray[row][col] << " ";
}
cout << endl;
}
}// end of displayMatrix