c++ default constructor

Both base class objects and member data objects are initialized in declaration order, regardless of the order in the initialization list in the constructor definition.


Destructors are called in the reverse order (which is the main reason why initialization is dependent on declaration order, rather than on the order in the initialization list).


Constructor 나 Initializer 관련된 것은 컴파일러가 적절하게 알려주니, 고쳐가며 코딩하기에는 문제가 없는데, 여기에 대한 이해도가 부족하면 struct 와 class 그리고 더 나아가 c-style 로 struct 를 다루는 것이 왜 문제가 되는지 이해하기 어렵게 된다.

Blog Logo

Ki Sung Bae



Gsong's Blog

Developer + Entrepreneur = Entreveloper

Back to Overview