Check out example codes for "how to write a class in c++". It will help you in understanding the concepts better.

Code Example 1

class Rectangle 
{
	int width, height;
public:
	void set_values (int,int);
    int area() {return width*height;}
};

void Rectangle::set_values (int x, int y)
{
	width = x;
	height = y;
}

Code Example 2

class MyClass {       
  // The class
  public:             
  // Access specifier
    int myNum;        // 
  Attribute (int variable)
    string myString;  // 
  Attribute (string variable)
};

Code Example 3

class class_name {
  access_specifier_1:
    member1;
  access_specifier_2:
    member2;
  ...
} object_names;

Code Example 4

class Rectangle {
    int width, height;
  public:
    void set_values (int,int);
    int area (void);
} rect;

Code Example 5

TYPE& dynamic_cast<TYPE&> (object);
TYPE* dynamic_cast<TYPE*> (object);

Learn ReactJs, React Native from akashmittal.com