What is the role of a default constructor exactly?
From Thinking in C++
The first hidden argument to the constructor is the this pointer. this
pointer holds the address of the caller object. In the case of constructor
this pointer points towards an uninitialized block of memory. It is the
job of the constructor to initialize this block of memory properly.
So, basically, the constructor is used to get a pointer to the object's
space in RAM? Is that correct?
How does the default constructor initialize that memory? Does it get
initialized to zero?
No comments:
Post a Comment