1. Computing & Technology

Discuss in my forum

Definition of Mangling

By , About.com Guide

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

©2012 About.com. All rights reserved.

A part of The New York Times Company.