_Cdecl和cdecl是什么意思。
解决方案 »
- 网间远程控制编程如何实现呢?
- PIP_ADAPTER_INFO结构问题?
- CDateTimeCtrl控件编辑问题
- vc++6.0 resource.h(资源文件) #define定义的宏有重复
- 请教高手Vista下SHBrowseForFolder API为什么不能正常使用?急!
- VC中内容因修改不对齐怎么解决?
- 请问控制台程序能不能用MSComm控件呢?
- 请问怎样建立文件关联呀!就想WORD一样,打开DOC文件自动打开了WORD!
- restricted to following uses.什么意思?
- 在new一个实例时,如果发现不符合条件,如何delete自己并返回NULL?
- 怎样利用别人写的界面类库!
- 100分求创意?在线等!!!
Argument-passing order Right to left
Stack-maintenance responsibility Calling function pops the arguments from the stack
Name-decoration convention Underscore character (_) is prefixed to names
Case-translation convention No case translation performed
Note For related information, see Decorated Names. Place the __cdecl modifier before a variable or a function name. Because the C naming and calling conventions are the default, the only time you need to use __cdecl is when you have specified the /Gz (stdcall) or /Gr (fastcall) compiler option. The /Gd compiler option forces the __cdecl calling convention.Example
In the following example, the compiler is instructed to use C naming and calling conventions for the system function:// Example of the __cdecl keyword
_CRTIMP int __cdecl system(const char *);//From MSDN
也就是函数的调用者将参数从右向左压堆栈后调用函数,函数完成后由调用者恢复堆栈,好处是可以声明参数不固定的函数