Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: default argument given for parameter 1

You are probably redefining the default parameter in the implementation of the function. It should only be defined in the function declaration.

//bad (this won't compile)
string Money::asString(bool shortVersion=true){
}

//good (The default parameter is commented out, but you can remove it totally)
string Money::asString(bool shortVersion /*=true*/){
}

//also fine, but maybe less clear as the commented out default parameter is removed
string Money::asString(bool shortVersion){
}