Programming Basicwhy 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.
 
原文地址:https://www.cnblogs.com/Winston/p/1081512.html