回 帖 发 新 帖 刷新版面

主题:这个类中的函数是什么

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;是什么意思?没有看明白

回复列表 (共1个回复)

沙发


后面有注释吧

我来回复

您尚未登录,请登录后再回复。点此登录或注册