Each language has its own default naming and calling conventions (Table 11.4).
Table 11.4 Default Naming and Calling Conventions
Language |
Calling Convention |
Naming Convention |
Parameter Passing |
BASIC | FORTRAN/Pascal | Case insensitive | Near reference |
C | C | Case sensitive | Value (scalar variables), reference (arrays and pointers) |
C++ | FORTRAN/Pascal | Case sensitive | Value (scalar variables), reference (arrays and pointers) |
FORTRAN | FORTRAN/Pascal | Case insensitive | Reference |
Pascal | FORTRAN/Pascal | Case insensitive | Value |
When you call BASIC routines from C, you must pass all arguments by near reference (near pointer). You can modify the conventions observed by BASIC routines that interface with C functions by using the DECLARE, BYVAL, SEG, and CALLS keywords. For more information on these keywords, see the Microsoft BASIC Language Reference or the Microsoft BASIC Programmer's Guide.
You can modify the conventions observed by FORTRAN routines that call C functions by using the INTERFACE, VALUE, PASCAL, and C keywords. For more information about the use of these keywords, see the Microsoft FORTRAN Reference.
You can modify the conventions observed by Pascal routines that interface with C functions by using the VAR, CONST, ADR, VARS, CONSTS, ADRS, and C keywords. For more information about the use of these keywords, see the Microsoft Pascal Compiler User's Guide.