首页 > 代码库 > C++ 修饰名的格式探究
C++ 修饰名的格式探究
以下结果是由VS2010里面测试得出:
------------------------------------------------------------------
/*函数名、类名、名称空间、@@、函数访问级别、调用约定、返回类型、参数类型、有无参数(@Z、XZ)函数名: ?函数名类名: @类名名称空间:@名称空间名函数访问级别:純函数是Y,静态类方法public,protected,private依次是S,K,C非静态类方法public,protected,private依次是QA,IA,AA调用约定:__cdecl 是 A , __stdcall 是 G对于返回类型与参数类型:void,char,signed char,unsigned char,short,unsigned short,int,unsigned int,long,unsigned long,float,double,long double,long long,unsigned long依次对应:X, D, C, E, F, G, H, I, J, K, M, N, O, _J, _K有无参数:有参数@Z、无参数XZ-------------------------------------------------------int foo(void); ?foo@@YAHXZshort foo(void); ?foo@@YAFXZshort foo(int, int); ?foo@@YAFHH@Zshort __cdecl foo(int, int); ?foo@@YAFHH@Zshort __stdcall foo(int, int); ?foo@@YGFHH@Zshort __stdcall muyou::foo(int,int) ?foo@muyou@@YGFHH@Zpublic: static short __stdcall muyou::a::foo(int,int) ?foo@a@muyou@@SGFHH@Zprotected: static short __stdcall muyou::a::foo(int,int) ?foo@a@muyou@@KGFHH@Zprivate: static short __stdcall muyou::a::foo(int,int) ?foo@a@muyou@@CGFHH@Zprivate: short __stdcall muyou::a::foo(int,int) ?foo@a@muyou@@AAGFHH@Zprotected: short __stdcall muyou::a::foo(int,int) ?foo@a@muyou@@IAGFHH@Zpublic: short __stdcall muyou::a::foo(int,int) ?foo@a@muyou@@QAGFHH@Z-------------------------------------------void foo(); ?foo@@YAXXZvoid foo(void); ?foo@@YAXXZvoid foo(char); ?foo@@YAXD@Zvoid foo(signed char); ?foo@@YAXC@Zvoid foo(unsigned char); ?foo@@YAXE@Zvoid foo(short); ?foo@@YAXF@Zvoid foo(signed short); ?foo@@YAXF@Zvoid foo(unsigned short); ?foo@@YAXG@Zvoid foo(int); ?foo@@YAXH@Zvoid foo(signed int); ?foo@@YAXH@Zvoid foo(unsigned int); ?foo@@YAXI@Zvoid foo(long); ?foo@@YAXJ@Zvoid foo(signed long); ?foo@@YAXJ@Zvoid foo(unsigned long); ?foo@@YAXK@Zvoid foo(float); ?foo@@YAXM@Zvoid foo(double); ?foo@@YAXN@Zvoid foo(long double); ?foo@@YAXO@Zvoid foo(long long); ?foo@@YAX_J@Zvoid foo(signed long long);?foo@@YAX_J@Zvoid foo(unsigned long long);?foo@@YAX_K@Z*/namespace muyou{ class a { public: short __stdcall foo(int, int); public: void vf(){foo(1, 1);} };}using muyou::a;int main(void){ a oa; oa.vf(); return 0;}
C++ 修饰名的格式探究
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。