There are many questions on this topic but many of them use inaccurate terms and the answers are mostly partial. I will try to ask it in yet a another way and hopefully come up with a polished answer to this frequent question.
What is the difference, if any, between default-initialization and zero-initialization in the case of PODs?
If a member POD variable is not initialized in the constructor initialization list, in which case will it be:
- zero-initialized.
- default-initialized (if different from above).
- left uninitialized.
Does the answer to question 2 above depend on whether the instance of the class is created on the stack or on the heap using the
new
operatorIs the answer to any of the above questions different for C++98,C++11 or C++14?