int Max(double f1,double f2){ } int Max(int n1,int n2){ } int Max(int n1,int n2,int n3){ }
void func(int x1, int x2 = 2, int x3 = 3){ } func(10);//等效于func(10,2,3) func(10,8);//等效于func(10,8,3) func(10,,8);//编译错误,只能最右边的连续若干个参数缺省
本文分享自 作者个人站点/博客 前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文参与 腾讯云自媒体分享计划 ,欢迎热爱写作的你一起参与!