【发布时间】:2012-04-14 06:12:12
【问题描述】:
我写了下面的类
class worker
{
int action;
int doJob(int type,int time = 0);
public:
int call();
}
而函数doJob就像
int worker::doJob(int type,int time = 0)
{
....code here
}
编译时出现如下错误
error: the default argument for parameter 1 of 'int worker::doJob(int, int)' has not yet been parsed
肯定是默认参数规范的问题..那么原型有什么问题?
【问题讨论】:
标签: c++ arguments default-arguments