At the time of object creation, if compiler finds that there is no constructor defined for your class, it generates one for you. Constructors are functions that are required to initialize the data members of a class (and to perform other crucial operations such as setting up VTABLE and defining a VPTR - if your class declaration has atleast one virtual function).
At the time of a new object creation by copy constructor or copy-assignment operator (i.e, when creating an object from an existing object), the compiler-generated copy constructor would perform a mere shallow copy (plain bit-wise copy) of values of the data members (that could lead to a dangling-pointer situation - if your class has a pointer data member and you happen to create more than one reference/pointer to your class object, and then the object gets destroyed via one of those - due to some intentional/un-intentional reason, leading to a crash if you access those dangling pointer(s)). Hence its always advised to define your own copy constructor and copy assignment operator, and perform a 'deep copy' of your pointer whenever your class has a "pointer data member".