The C++–Pascal Interface
155
7
Procedure Calls: Pascal–C++
A Pascal main program can also call C++ functions. The following examples
show you how to pass simple types and arguments and include the commands
that are used to compile and execute the final programs.
Arguments Passed by Reference
Pascal arguments can be passed by reference. Here we discuss how they work
with C++.
The C++ main program,
IOMain.cc
#include <stdio.h>
extern "C" {
void IO ();
};
int main(void)
{
IO ();
printf ("Hello, C++ ! \n");
}
The commands to compile and
execute
IO.p
and
IOMain.cc
hostname% pc -c IO.p
hostname% CC IO.o IOMain.cc -lpc
hostname% a.out
Hello, Pascal & St.Petersburg !
Hello, C++ !
Содержание 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: ......