Aug 11, 2002 #1 Guest_imported New member Joined Jan 1, 1970 Messages 0 Does anyone have a good example of a class?
Aug 11, 2002 #2 chipperMDW Programmer Joined Mar 24, 2002 Messages 1,268 Location US [tt]class Point_2D { public: Point( int x = 0, int y = 0 ) : x_(x), y_ {} void setX( int x ) { x_ = x; } void setY( int y ) { y_ = y; } int getX() { return x_; } int getY() { return y_; } private: int x_; int y_; }; [/tt] Upvote 0 Downvote
[tt]class Point_2D { public: Point( int x = 0, int y = 0 ) : x_(x), y_ {} void setX( int x ) { x_ = x; } void setY( int y ) { y_ = y; } int getX() { return x_; } int getY() { return y_; } private: int x_; int y_; }; [/tt]
Sep 3, 2002 #3 KeavDog Programmer Joined Sep 3, 2002 Messages 9 Location US Look at CPoint Upvote 0 Downvote