一下是原题:
typedef string Type;
Type initVal();
class Exercise
{
public:
typedef double Type;
Type setVal(Type);
Type initVal();
private:
int val;
};
Type Exercise::setVal(Type parm)
{
val = parm+initVal();
}
这是我更改后的:
typedef string Type;
Type initVal();
class Exercise
{
public:
typedef double Type;
Type setVal(Type);
Type initVal();
private:
int val;
};
Exercise::Type Exercise::setVal(Exercise::Type parm)
{
val = parm+Exercise::initVal();
return val;
}