December 2021
Intermediate to advanced
352 pages
9h 32m
English
We will start this chapter with a scenic detour. Consider Core Guideline NR.5: “Don’t use two-phase initialization.” This is referring to the habit of constructing an object and then calling an initialization function. This practice dates from the last century, when C was the very thing, and one would declare an object on the stack or allocate some memory from the free store and then initialize it. If you were really on top of things, you would define a function that took a pointer to your struct and call it my_struct_init or something like that.
The two phases were allocate, ...
Read now
Unlock full access