The C–Pascal Interface
101
6
Conformant Arrays
For single-dimension conformant arrays, pass upper and lower bounds, placed
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.
See this example:
One bounds pair may apply to several arrays if they are declared in the same
parameter group:
With multidimensional arrays, for all dimensions but the last one, pass the low
bound, high bound, and element width.
The commands to compile and
execute
UniVec.p
and
UniVecMain.c
with
-calign
hostname% pc -c -calign UniVec.p
hostname% cc UniVec.o UniVecMain.c -lpc
hostname% a.out
24
function ip(var x: array [lb..ub: integer] of real): real;
extern double ip(double [], int, int);
...
double v1[10];
double z;
z = ip(v1, 0, 9);
...
function ip(var x,y:array[lb..ub:integer] of real):real;
...
double v1[10], v2[10] ;
extern double ip() ;
double z ;
z = ip ( v1, v2, 0, 9 ) ;
...
Содержание SunSoft Pascal 4.0
Страница 14: ...xiv Pascal 4 0 User s Guide ...
Страница 16: ...xvi Pascal 4 0 User s Guide ...
Страница 30: ...6 Pascal 4 0 User s Guide 1 ...
Страница 160: ...136 Pascal 4 0 User s Guide 6 ...
Страница 268: ...244 Pascal 4 0 User s Guide 11 ...
Страница 320: ...296 Pascal 4 0 User s Guide B ...
Страница 331: ...Index 307 ...
Страница 333: ......