![](/images/backgrounds/286549/hp-sunsoft-pascal-4-0-users-manual-549395138x1.png)
6
The Pascal procedure,
ChrCAVal.p
The C main program,
ChrCAValMain.c
Since C cannot pass arrays by value, it cannot pass strings of characters, fixed arrays, or univ arrays by value.
Conformant Arrays
Pascal passes all value parameters on the stack or in registers, except for value conformant array parameters, which are handled by creating a copy in the caller environment and passing a pointer to the copy. In addition, the bounds of the array must be passed (see “Conformant Arrays” on page 101).
This example is the same as the
procedure ChrCAVal(a: array [lb..ub: integer] of char); begin
a[0] := 'T';
a[13] := 'o'; end; { ChrCAVal }
#include <stdio.h>
extern void ChrCAVal(char [], int, int);
int main(void)
{
static char s[] = "This is a string";
ChrCAVal(s, 0, sizeof(s)
}
114 | Pascal 4.0 User’s Guide |