Check out example codes for "how to initialize the object in constructor in c++". It will help you in understanding the concepts better.

Code Example 1

BigMommaClass {
    BigMommaClass(int, int);

private:
    ThingOne thingOne;
    ThingTwo thingTwo;
};

BigMommaClass::BigMommaClass(int numba1, int numba2): thingOne(numba1 + numba2), thingTwo(numba1, numba2) {
// Code here
}

Code Example 2

class MyClass {     // The class
  
  public:           
  // Access specifier
    MyClass() {     
  // Constructor
      cout << "Hello World!";
    
  }
};

int main() {
  MyClass myObj;    // Create an object of MyClass (this will call 
  the constructor)
  return 0;
}

Learn ReactJs, React Native from akashmittal.com