Name: Anonymous 2007-07-21 19:07 ID:KiegSQe4
I'm currently in my first C++ class (on chapter 3 of the book), and this is a question that I have to answer.
How are an object’s data members initialized if a class has only an implicitly defined default constructor?
The passage that I'm reviewing in the book says:
The compiler implicitly creates a default constructor in a class that does not define a constructor. Such a default constructor does not initialize the class's data members, but does call the default constructor for each data member that is an object of another class.
The first answer I thought of was the object's data members aren't initialized, but the book says class's data members and not object's. And I'm not fully understanding what the second part from the book means.
I was hoping for some clarification and guidance.
How are an object’s data members initialized if a class has only an implicitly defined default constructor?
The passage that I'm reviewing in the book says:
The compiler implicitly creates a default constructor in a class that does not define a constructor. Such a default constructor does not initialize the class's data members, but does call the default constructor for each data member that is an object of another class.
The first answer I thought of was the object's data members aren't initialized, but the book says class's data members and not object's. And I'm not fully understanding what the second part from the book means.
I was hoping for some clarification and guidance.