Since C++ supports function overloading, additional information has to be added to function names (called Name mangling) to avoid conflicts in binary code. 2. Function names may not be changed in C as it doesn't support function overloading. To avoid linking problems, C++ supports the extern “C” block.
C++ supports function overloading, i.e., there can be more than one function with the same name but, different parameters. How does the C++ compiler distinguish between different functions when it generates object code – it changes names by adding information about arguments. This technique of adding additional information to function names is called Name Mangling. C++ standard doesn’t specify any particular technique for name mangling, so different compilers may append different information to function names.
标签:function,information,different,Name,Mangling,C++,names,extern From: https://www.cnblogs.com/tju1895/p/17593025.html