
Faculty Supervisor: Al Day
Some material derived from lessons authored by
Dr. Larry Genalo
HTML documentation by: Julie Sandberg
Date last updated: 7/24/96
![]()
Subscripted Array: A systematic diagrammatical
representation of a subscripted variable
![]()

Arrays are declared with the other variables in the program.
![]()
int n, m;
double x[5][6];
FILE *inp;
inp = fopen("IN.DAT","r");
for (n = 0; n < 5; ++n) {
for (m = 0; m < 6; ++m)
fscanf (inp, "%lf", &x[n][m]);
}
fclose (inp);
int n, m;
double x[5][6];
FILE *outp;
outp = fopen("OUT.DAT","w");
for (n = 0; n < 5; ++n) {
for (m = 0; m < 6; ++m)
fprintf (outp, "%10.4f", x[n][m]);
fprintf (outp, "\n");
}
fclose (outp);
Produces a table of output
![]()
![]()
![]()
Multi-dimensional arrays must be fully dimensioned in the "calling" module, and partially dimensioned in the source function.
As always, the name of the array may be different in each module, but it must be in the same position in the list and agree in type
![]()

![]()


![]()