C++

您所在的位置:网站首页 函数参数没有定义默认的返回值是 C++

C++

#C++ | 来源: 网络整理| 查看: 265

函数参数默认值(缺省函数) 必须从右向左依次赋值 不可以重复赋值(同一个文件) //调用不明确

函数参数在有默认值时,如果调用时没有传参,则默认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 办公设备维修网 版权所有 豫ICP备15022753号-3