Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Class

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Does anyone have a good example of a class?
 
[tt]class Point_2D
{
public:
Point( int x = 0, int y = 0 )
: x_(x), y_(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]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top