... each mangled name (other than main
) begins with two underscores (__
) followed by the letter Z
, a number and the function name. The number that follows Z
specifies how many characters are in the function’s name. For example, function square

Fig. 6.21 Name mangling to enable type-safe linkage.
Alternate View
1 // Fig. 6.21: fig06_21.cpp
2 // Name mangling to enable type-safe linkage.
3
4 // function square for int values
5 int square(int x) {
6 return x * x;
7 }
8
9 // function square for double values
10 double square(double y) {
11 return y * y;
12 }
13
14 // function that receives arguments of types
15 // int, float, char and int&
16 void nothing1( ...
Get C++ How to Program, 10/e now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.