![](/images/backgrounds/286549/hp-sunsoft-pascal-4-0-users-manual-549395179x1.png)
7
The C++ main program, | #include <stdio.h> | ||
IOMain.cc |
|
|
|
| extern | "C" | { |
| void | IO | (); |
| }; |
|
|
int main(void)
{
IO ();
printf ("Hello, C++ ! \n");
}
The commands to compile and | hostname% pc | ||
execute IO.p and IOMain.cc | hostname% CC | IO.o IOMain.cc | |
| hostname% a.out | ||
| Hello, | Pascal & St.Petersburg ! | |
| Hello, | C++ ! |
|
|
|
|
|
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 | 155 |