The C++–Pascal Interface
139
7
Arguments Passed by Reference
C++ arguments can be passed by reference. This section describes how they
work with Pascal.
The C++ main program,
SampMain.cc
#include <stdio.h>
extern "C" void Samp (int&, double&);
int main(void)
{
int i;
double d;
Samp (i, d);
printf ("%d %3.2f \n", i, d);
}
The commands to compile and
execute
Samp.p and
SampMain.cc
:
c
hostname% pc -c Samp.p
hostname% CC Samp.o SampMain.cc -lpc
hostname% a.out
7 3.14
Summary of Contents for SunSoft Pascal 4.0
Page 14: ...xiv Pascal 4 0 User s Guide ...
Page 16: ...xvi Pascal 4 0 User s Guide ...
Page 30: ...6 Pascal 4 0 User s Guide 1 ...
Page 160: ...136 Pascal 4 0 User s Guide 6 ...
Page 268: ...244 Pascal 4 0 User s Guide 11 ...
Page 320: ...296 Pascal 4 0 User s Guide B ...
Page 331: ...Index 307 ...
Page 333: ......