I have started studying thinking in c++ , in the chapter "Initialization and cleanup" I have doubt .The author says "you might be thinking the compiler default constructor does some intelligent work like setting all the memory for the objects to zero, but it is not so." My doubt is I used to think the compiler default constructor provides initialization like it will set all the data members to zero I mean if they are of integer value. Then what exactly it does?
It is good especially for larger objects, which are going to be initialized with useful values before use anyway. For example, if you allocated an array with a very large number of elements, wouldn't it be much more efficient to simply set the values to the useful data (ignoring the old garbage values) rather than zeroing it out and then setting the data (ignoring the 0's)?