| <<< Creating your own classes | Index | Scope of variables >>> |
////////////////////////////////////////////////////////
// point.h
class Point
{
public:
int x; // member variables
int y;
void adjust( int xx, int yx ); // member declaration
};
////////////////////////////////////////////////////////
// point.cpp
#include "point.h"
void Point::adjust( int xx, int yy ) // member definition
{
x += xx; // Note: access to member variables is easy
y += yy;
}
| <<< Creating your own classes | Index | Scope of variables >>> |