![](/images/backgrounds/286549/hp-sunsoft-pascal-4-0-users-manual-549395139x1.png)
6
The commands to compile and execute ChrCAVal.p and ChrCAValMain.c with
hostname% pc
hostname% a.out This is a string
Function Return Values
The Pascal function,
RetReal.p
The C main program,
RetRealMain.c
Function return values match types the same as with parameters, and they pass in much the same way.
Simple TypesThe simple types pass in a straightforward way, as follows:
function RetReal(x: real): real; begin
RetReal := x + 1.0 end; { RetReal }
#include <stdio.h>
extern double RetReal(double);
int main(void)
{
double r, s;
r = 2.0;
s = RetReal(r); printf(" %f \n", s);
}
The | 115 |