7

The C++ main program,

SimValMain.cc

The commands to compile and execute SimVal.p and

SimVal.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;

}

hostname% pc -c SimVal.p

hostname% CC SimVal.o SimValMain.cc -lpc hostname% a.out

args = 111111

Function Return Values

Function return values match types in the same manner as with parameters. They pass in much the same way.

152

Pascal 4.0 User’s Guide