I have encounter an error saying "redefinition of default argument" while I am compiling some codes. This is the line that is throwing the error:
bool wCommandDistributor::initialise (const bool server = true, const short ncmds=0,
byte (*cmds)[CMD_MAX_RECLEN] = (byte (*)[CMD_MAX_RECLEN])0)
Is there anyway that I can rewrite the code in order to solve the error? This is not a code written by me. I am helping to rewrite the code and it is written in C++.
Thanks in advance.
The compiler says it all, you are redefining the default arguments of initialise
(even though they might be the same).
The default arguments were probably already defined in the function declaration. You don't need to redefine them in the function definition, and so you should remove them.
But only the ones that were already defined in the declaration, it might be that some were not defined in the declaration, only in the definition. In this case you should naturally leave them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With