Function return values – HP SunSoft Pascal 4.0 User Manual
Page 176
Advertising
152
Pascal 4.0 User’s Guide
7
Function Return Values
Function return values match types in the same manner as with parameters.
They pass in much the same way.
The C++ main program,
SimValMain.cc
#include <stdio.h>
extern "C" void SimVal(
char,
char,
char,
short,
int,
float,
double,
int &);
int main(void)
{
char
t = 1, f = 0, c= 'z';
short si = 9;
int
i=9;
float
sr = 9.9;
double
r =9.9;
int
args;
SimVal (t, f, c, si, i, sr, r, args);
printf (" args = %07o \n", args);
return 0;
}
The commands to compile and
execute
SimVal.p
and
SimVal.cc
hostname% pc -c SimVal.p
hostname% CC SimVal.o SimValMain.cc -lpc
hostname% a.out
args = 111111
Advertising