int boxvolume(int length,int width,int height); //看书上说默认值可以写在申明也可以写在函数头,我写在函数头怎么,在gcc里编译错误
// too few arguments to function 'int boxvolume(int, int, int)' 在gcc里编译错误
int main()
{
cout<<"the default:"<<boxvolume()<<endl;
return 0;
} // end main
int boxvolume(int length=1,int width=1,int height=1) //默认值写在函数头
{
int boxvolume(int length,int width,int height); //看书上说默认值可以写在申明也可以写在函数头,我写在函数头怎么,在gcc里编译错误
// too few arguments to function 'int boxvolume(int, int, int)' 在gcc里编译错误
写在函数声明上