|
|
Because it is common to link a C++ function with functions generated by another language (such as C), C++ allows you to specify a linkage specification that tells the compiler how to link a function. It has this general form:
extern "language" function-prototype
As you can see, the linkage specification is an extension to the extern keyword. Here, language denotes the language to which you want the function to link. C and C++ linkages are guaranteed to be supported. Your compiler may support other linkages, too. To declare several functions using the same linkage specification, you can use this general form:
extern"language" { function-prototypes }
The linkage specification applies only to C++. It is not supported by C.
|
|