Absent. You just get lucky. Fundamental types remain uninitialized, so your i and ch , since the program is standing, may not always be 0.
It just happens, adding that the public member "messed it up." To fix your class, initialize the elements in the constructor initialization list:
class Base { private: int i; char ch; public: Base(void) : i(0), ch(0)
Now, when a Base is created i , ch and (when uncommenting) pub_data will be correctly initialized for significant values.
source share