class Box // Class of Box - this is a description not an Instance
{
public: // Any client can access Public Methods
void SetWidth(int Input); // Declaration of Method to set width
private: // Members are only available through Methods
int Width, Length, Height; // Class Members (Properties)
}
void Box::SetWidth(int Input) // Definition of Method to set width
{
Width = Input;
}
Box MyBox; // Object (Instance) MyBox of Class Box
MyBox.SetWidth(2); // This will set the Width for the Object MyBox to 2
--------------------------------------------------------------------
In C++ Properties are known as "Member Variables" or "Data Members"
Does this help??
Alan.
|