C++ |
您所在的位置:网站首页 › 函数参数没有定义默认的返回值是 › C++ |
函数参数默认值(缺省函数)
必须从右向左依次赋值 不可以重复赋值(同一个文件) //调用不明确
函数参数在有默认值时,如果调用时没有传参,则默认push默认值。 实例一:不带默认值 #include using namespace std; int fun(int a, int b, int c); int main() { fun(10, 20, 30); //若有默认值,且调用时未传参,则push 默认值 /* push 30 // push 20 push 10 call fun() add esp,0ch */ return 0; } int fun(int a, int b, int c) { /* push abp mov ebp,esp sub esp,Occh …… */ cout cout cout cout |
今日新闻 |
点击排行 |
|
推荐新闻 |
图片新闻 |
|
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭 |