Name mangling is very common in C++ compilers when a function have the same name with different parameters or overloading.
As the compiler compiles your code, with a function with the same name , the compiler tries to rename the function or method so they dont clash with each other at runtime and providing different signature.
Using Extern “C” on the other hand if you are calling a C function exactly as it is from your C++ code. With a syntax of
extern “C” statement or block of code
This prevent the compiler from mangling the name at compile time otherwise getting bunch of errors and crashes.
Here are some good articles about it:
Here some good link about Calling Convention: eg. __stdcall, __cdecl