Jump to content
  • Advertisement
Sign in to follow this  
nGamer

Constructors in a composite class

This topic is 3047 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

What's up GameDevers, If a class has other classes as data member, when that class's constructor is invoked, are the constructors of the classes that belong to it invoked as well?

Share this post


Link to post
Share on other sites
Advertisement
For a class A, the constructors of all A's member variables will be called before execution flow will enter the first curly brace any of A's constructors.

Share this post


Link to post
Share on other sites
Quote:
Original post by mrchrismnh
seriously?
Why not clarify, so that we can better understand what you're getting at?

Share this post


Link to post
Share on other sites
Quote:
Original post by mrchrismnh
I mean does he really not understand what I am saying, or is he chiding me for not being precise about it. I suspect the latter.
I have a pretty good guess as to what you're trying to say, but it's just that (a guess).

Really, how hard would it be to give an example, or go into just a little more detail so that there's no ambiguity?

Share this post


Link to post
Share on other sites

This topic is 3047 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!