![](/images/backgrounds/286549/hp-sunsoft-pascal-4-0-users-manual-549395162x1.png)
7
Compatibility of Types for C++ and Pascal
Table
C++ Name Encoding
To implement function overloading and
extern "C" void f (int);
...
void f (int) { /* ...body of f... */ }
For brevity, you can also combine extern "C" with the definition of the function, as in:
extern "C" void f (int) { /* ...body of f... */ }
Procedure Calls: C++–Pascal
Following are examples that illustrate how a C++ main program calls a Pascal procedure. Included in each example are the Pascal procedure, the C++ main program, and the commands to compile and execute the final program.
The Pascal procedure, Samp, | procedure Samp (var i: integer; var r: real); |
in the file, Samp.p |
|
| begin |
| i := 7; |
| r := 3.14; |
| end |
|
|
138 | Pascal 4.0 User’s Guide |