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
Содержание SunSoft Pascal 4.0
Страница 14: ...xiv Pascal 4 0 User s Guide ...
Страница 16: ...xvi Pascal 4 0 User s Guide ...
Страница 30: ...6 Pascal 4 0 User s Guide 1 ...
Страница 160: ...136 Pascal 4 0 User s Guide 6 ...
Страница 268: ...244 Pascal 4 0 User s Guide 11 ...
Страница 320: ...296 Pascal 4 0 User s Guide B ...
Страница 331: ...Index 307 ...
Страница 333: ......