define a class in c++ code example
Example 1: classes c++
class Rectangle {
int width, height;
public:
void set_values (int,int);
int area (void);
} rect;
Example 2: create class instance c++
MyClass* MyObject = new MyClass();
class Rectangle {
int width, height;
public:
void set_values (int,int);
int area (void);
} rect;
MyClass* MyObject = new MyClass();