Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Beginner in C++, Really need help.

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.

Name: Anonymous 2007-07-21 20:47 ID:Heaven

Um, what's their not to get? It's just like the passage says, integral types are not initialized, object (aggregate) types will get their default ctor called. I suspect the OP is a troll. Proceed with caution.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List