Check out example codes for "creating classes c++". It will help you in understanding the concepts better.

Code Example 1

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

Code Example 2

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

int main() {
  MyClass myObj;  
  // Create an object of MyClass

  // Access attributes and set values
  myObj.myNum 
  = 15; 
  
  myObj.myString = "Some text";

  // Print attribute values
  
  cout << myObj.myNum << "\n"; 
  cout << myObj.myString; 
  return 0;
}

Learn ReactJs, React Native from akashmittal.com