I wrote the following class
class worker
{
int action;
int doJob(int type,int time = 0);
public:
int call();
}
And the doJob function is similar to
int worker::doJob(int type,int time = 0)
{
....code here
}
When I compile, I get the following error
error: the default argument for parameter 1 of 'int worker::doJob(int, int)' has not yet been parsed
This is undoubtedly a problem with the specification of default parameters. So what is the problem with the prototype?
source
share