1.函数的重载:若没有给y z赋默认值,则不可使用int a=f(b)(除非在定义一个只有一个参数的重载),重载和赋默认值不可同时使用
int f(int x,int y=0,int z=1)
{
return x+y+z;
}
int b=3;
int a=f(b);
int f(int x,int y=0,int z=1)
{
return x+y+z;
}
int b=3;
int a=f(b);