Linkage Specification

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.




C(s)C++ Programmer's Reference
C Programming on the IBM PC (C Programmers Reference Guide Series)
ISBN: 0673462897
EAN: 2147483647
Year: 2002
Pages: 539

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net