Ray's playground

 

Name Control(Chapter 10 of Thinking in C++)

  The escape mechanism provided in C++ is the alternate linkage specification, which was produced in the language by overloading the extern keyword. The extern is followed by a string that specifies the linkage you want for the declaration, followed by the declaration:
  extern "C" float f(int a, char b);
  This tells the compiler to give C linkage to f( ) so that the compiler doesn’t decorate the name. The only two types of linkage specifications supported by the standard are “C” and “C++,” but compiler vendors have the option of supporting other languages in the same way.

posted on 2010-11-20 15:55  Ray Z  阅读(171)  评论(0编辑  收藏  举报

导航