![](/images/backgrounds/286549/hp-sunsoft-pascal-4-0-users-manual-549395141x1.png)
6
The commands to compile and execute IO.p and IOMain.c
hostname% pc
hostname% cc IO.o IOMain.c
hostname% a.out
Hello Pascal and St. Petersburg! Hello C!
Procedure Calls: Pascal–C
This section parallels the section, “Procedure Calls:
Earlier comments and restrictions also apply here.
Variable Parameters
Pascal passes all variable parameters by reference, which C can do, too.
Simple Types
Simple types pass in a straightforward manner, as follows:
The C function, SimRef.c | void SimRef( |
|
| char | *t, |
| char | *f, |
| char | *c, |
| short | *si, |
| int | *i, |
| float | *sr, |
| double | *r) |
| { |
|
*t = 1; *f = 0; *c = 'z'; *si = 9; *i = 9; *sr = 9.9; *r = 9.9;
}
The | 117 |