c++ define a class code example
Example 1: classes c++
class Rectangle {
int width, height;
public:
void set_values (int,int);
int area (void);
} rect;
Example 2: class in c++
class Name {
private:
int data;
public:
// Constructor
Name() {
// Code
}
int id;
void fun1(int a) {
// Some instructions here
}
}