The Magic of Name Mangling
Introduction I’d always wondered why it’s impossible to define two functions with the same name in C, even if they have different parameters. Every time I tried, I’d get a linker error saying, “bro, you can’t do it”, while doing the same in C++ and other compiled languages worked fine. Eventually, I learned that the difference lies in a compilation technique known as name mangling. Definition Name mangling (also called name decoration) is a technique used to solve various problems caused by the need to resolve unique names for programming entities in many modern programming languages. ...