![](/images/backgrounds/286549/hp-sunsoft-pascal-4-0-users-manual-549395147x1.png)
6
The
| Conformant Arrays |
| For |
| after the declared parameter list. If the array is multidimensional, pass |
| element widths as well, one element width for each dimension, except the last |
| one. Chapter 8, “The |
| multidimensional conformant array passing. |
| The following example uses a |
The C function, IntCA.c |
|
void IntCA(int a[], int lb, int ub) | |
| { |
| int k; |
| for (k=0; k <= ub - lb; k++) |
| a[k] = 4; |
| } |
|
|
The Pascal main program, IntCAMain.p. Note that what Pascal passes as s, is received in C as a, lb, ub.
program IntCAMain(output);
var
s:array [1..3] of integer;
i:integer;
procedure IntCA(var a: array [lb..ub: integer] of integer); external c;
begin IntCA(s);
for i := 1 to 3 do write(s[i]);
writeln
end. { IntCAMain }
The | 123 |