Programming Basic--why we need to add ' extern "C" ' in C++ program when calling the function which is complied by C complier?

      C++ support overload, but C not. and the name of function in library which is complied by C++ complier is different from that which is complied by C complier. for example: if a function prototype is like that: void foo(int x, int y). the name of this function complied in C complier is  _foo, while _foo_int_int in C++.
        C++ provides C link flag extern "C" to resolove the name match issue.
 

posted on 2008-02-26 08:49  飞天舞者  阅读(180)  评论(0编辑  收藏  举报

导航

For more information about me, feel free email to me winston.he@hotmail.com