Hi Everybody, I have to read about Constructors, Destructor, Public and Private. I don't understand all the tutorials online. Can someone explain it to me in simple logic.
The constructor is what is called when you construct a new object. The constructor is also used to initialize any variables that need to be. The destructor is called when the object is destroyed. The destructor is also used to clean up any possible memory leaks (if you are not using smart pointers). Public means that the variable/method can be accessed by anyone. Private means that only that class has access to the variable/method.