100DaysOfGameDev: Day 18

Today's chapter was on constructors and destructors. It talked about why are constructors useful in establishing covariants, and destructors that do proper cleanup. Also, it talked about the order of their execution, that is constructor constructs in a top-down approach starting with the base class and destructor cleaning up from inside-out ( just don't forget the virtual). There are a few cases, where you would manually want to call the destructor, but usually, it will be called when the object gets out of scope. Furthermore, object initialization was discussed, where usually {} is almost always preferred over (), the only exception being vector and other used defined types where each has a different meaning. vector<int> a{10} means a vector with single integer value 10, whereas vector<int> a(10) would mean vector with ten integers all zeros. That's it for today, catch you later!