int main( void )
{
//declare a reference variable extern void pas_func( short & ); short x;
...
pas_func( x );
...
}
Using extern "C" Linkage
To mix C++ modules with HP FORTRAN 90 modules, you must use extern "C" linkage to declare any C++ functions that are called from a
Strings
HP aC++ strings are not the same as HP FORTRAN 90 strings. In FORTRAN 90, the strings are not null terminated. Also, strings are passed as string descriptors in FORTRAN 90. This means that the address of the character item is passed and a length by value follows.
NOTE: If you use the HP FORTRAN 90 +800 option, the length follows immediately after the character pointer in the parameter list. If you do not use this option, HP FORTRAN 90 passes character lengths by value at the end of the parameter list.
Refer the HP FORTRAN/9000 Programmer’s Reference Guide and HP FORTRAN/9000 Programmer’s Guide for information about the +800 option.
Arrays
HP aC++ stores arrays in
Files in FORTRAN
HP FORTRAN I/O routines require a logical unit number to access a file, whereas HP aC++ accesses files using
A FORTRAN logical unit cannot be passed to a C++ routine to perform I/O on the associated file; also a C++ file pointer cannot be used by a FORTRAN routine. However, a file created by a program written in either language can be used by a program of the other language if the file is declared open within the latter program.
Refer to your system FORTRAN manual on
194 Mixing C++ with Other Languages