64,654
社区成员
发帖
与我相关
我的任务
分享
typedef double Money;
class Account
{
public:
Money balance(){return bal;} //uses global definition of Money
private:
//error:cannot change meaning of Money
typedef long double Money;
Money bal;
};
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();
}