C / C++ / C#

  1. Home
  2. Computing & Technology
  3. C / C++ / C#

Definition of Mangling

By David Bolton, About.com

Definition: Mangling is a feature of C++ where function names (most usually) and struct, class or other types have some kind of encoding added to the name to give a clue to the linker about the types involved. a function convert that passes in an int and a float might be mangled to convert_zi4f4. The linker can extract this type info and verify that the convert function linked to does have an int and float parameter. Different compilers use different mangling schemes.

To use C++ with C, usethe extern function to prevent C++ function etc being mangled like this:

extern "C" {
   void convert(int i,float f);
...
}

Glossary:

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Also Known As: Name decoration

Explore C / C++ / C#

About.com Special Features

C / C++ / C#

  1. Home
  2. Computing & Technology
  3. C / C++ / C#
  4. Glossary
  5. M
  6. Mangling - Definition

©2009 About.com, a part of The New York Times Company.

All rights reserved.