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.
 

你可能感兴趣的:(programming)