The name mangling C + +

Source: Internet
Author: User

C language
Rules:

1, __cdecl
In this declarative way, only an underscore is added to the function name, and the function return value, parameter, is not processed at all.
2, __stdcall
In this declarative way, precede the function name with an underscore, followed by the "@" symbol, and finally the sum of the function parameter size (NOTE: This sum contains a byte fill).
3, __fastcall
In this declarative way, the only difference with __stdcall is that the underscore in front of the function becomes the "@" symbol.

Function

1, void __calltype f ();
2, int __calltype f ();
3, int __calltype f (int);
4, double __calltype f (int, double);
5, int* __calltype f (int*, char*);

__cdecl

1, _f
2, _f
3, _f
4, _f
5, _f

__stdcall

1. [Email protected]
2. [Email protected]
3. [Email protected]
4. [Email protected]
5. [Email protected]

__fastcall

1, @[email protected]
2, @[email protected]
3, @[email protected]
4, @[email protected]
5, @[email protected]


C + + language

The name mangling C + +

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.