Giriş
Açıklaması şöyle. Yani Linker için gereklidir.
Name mangling is the encoding of function and variable names into unique names so that linkers can separate common names in the language.
Eğer C kütüphanesini C++ ile kullanmak istersek name mangling olmasını istemeyiz. Bu durumda extern "C" kullanmak gerekir.
Örnek
Açıklaması şöyle
Rakamların açıklaması şöyle
If you have ever looked at an objdump of a C++ program, you have likely seen something like this:_ZN3foo3bar3bazI6sampleEE3quxvi3fo
This is a C++ mangled symbol, which encodes the namespaces, classes, and function/template arguments, using the Itanium ABI.Specifically, it is for the following function:void foo::bar::baz<sample>::qux(int, foo);
- All mangled symbols start with _Z.- Everything is case sensitive.- All identifiers are encoded as <length><name>, where <length> is the positive length of <name> in base 10, so foo is encoded as 3foo, sample is encoded as 6sample, etc.