主题:这个类中的函数是什么
class Move
{
private:
double x;
double y;
public:
Move(double a = 0, double b = 0); //sets x, y to a,b
void showmove() const; //shows current x,y values
[size=2][color=FF00FF] Move add(const Move & m) const;[/color][/size]
/* this function adds x of m to x of invoking object(调用对象) to get new x,
adds y of m to y of invoking object to get new y, creates a new Move object
initialized to new x, y values and return it */
void reset(double a = 0, double b = 0); //resets x, y to a, b
};
这个类中的Move add(const Move & m) const;是什么意思?没有看明白
{
private:
double x;
double y;
public:
Move(double a = 0, double b = 0); //sets x, y to a,b
void showmove() const; //shows current x,y values
[size=2][color=FF00FF] Move add(const Move & m) const;[/color][/size]
/* this function adds x of m to x of invoking object(调用对象) to get new x,
adds y of m to y of invoking object to get new y, creates a new Move object
initialized to new x, y values and return it */
void reset(double a = 0, double b = 0); //resets x, y to a, b
};
这个类中的Move add(const Move & m) const;是什么意思?没有看明白