94
Pascal 4.0 User’s Guide
6
Variable Parameters
Pascal passes all variable parameters by reference, which C can do, too.
The C main program,
SampMain.c
. Note the
procedure definition and call.
#include <stdio.h>
extern void Samp(int *, double *);
int main (void)
{
int i ;
double d ;
Samp(&i, &d) ;
printf ("%d %3.1f \n", i, d) ;
}
The commands to compile and
execute
Samp.p
and
SampMain.c
hostname% pc -c Samp.p
hostname% cc Samp.o SampMain.c
hostname% a.out
9 9.9
Содержание 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: ......