<<< Quick Disassembly Examination of Executable Image | Index | Final Project: "Running Total" Calculator >>> |
C/C++ extern keyword specifies that external linkage conventions to link with other languages should used by the variable or function declarator.
extern-declared functions and data become visible to the linker accross multiple .OBJ modules.
However, the extern functions must be defined in a separately compiled translation unit(s).
The following sample demonstrates C++ program calling COPYNEW( ) function defined in the module written in Assembly. The sample contains the following files:
M13_main.cpp ( download ) the main driver program.
M13_NEWARRAY.h ( download ) C++ header file declaring extern functions.
M13_NEWARRAY.cpp ( download ) C++ implementation file defining external functions.
M13_COPYNEW.ASM ( download ) Assembly program that dynamically allocates block of memory and makes copy of the source string.
<<< Quick Disassembly Examination of Executable Image | Index | Final Project: "Running Total" Calculator >>> |