![](/images/backgrounds/286549/hp-sunsoft-pascal-4-0-users-manual-549395128x1.png)
6
The commands to compile and execute RealCA.p and RealCAMain.c with
The Pascal procedure,
ChrCAVar.p
hostname% pc
1.00.0 0.0
0.01.0 0.0
If wc is the width of the smallest element, as determined by sizeof(), then the width of the next largest element is the number of those smaller elements in the next larger element multiplied by wc.
width of next largest element = (ub - lb + 1) * wc
In general, (lb, ub, wc) are the bounds and element width of the next lower dimension of the array. This definition is recursive.
Example 3: Array of Characters
procedure ChrCAVar(var a: array [lb..ub: integer] of char);
begin
a[0] := 'T';
a[13] := 'o'; end; { ChrCAVar }
The C main program, ChrCAVarMain.c. For C, the lower bound is always 0.
#include <stdio.h>
extern void ChrCAVar(char [], int, int);
int main(void)
{
static char s[] = "this is a string" ;
ChrCAVar( s, 0,
}
104 | Pascal 4.0 User’s Guide |