c++中函数的参数中有...是什么意思?高手请进(

来源:百度知道 编辑:UC知道 时间:2024/06/10 16:31:31
形如char *__cdecl CScriptAction::Format(const char *fmt, ...))

...是省略,表示还可以有别的参数,也可以没有.
c++可以有多个同名函数,区别在参数个数不等.

__cdecl 是一种调用方式,其它方式有__stdcall, __fastcall等.
cdecl 调用建立的可执行码体积大,它包括建立清除堆栈等代码....

其他部分,相信你都懂.

C和C++的默认参数压栈方式。
MSDN上的详细的解释。
This is the default calling convention for C and C++ programs. Because the stack is cleaned up by the caller, it can do vararg functions. The __cdecl calling convention creates larger executables than __stdcall, because it requires each function call to include stack cleanup code. The following list shows the implementation of this calling convention.