Jump to content
  • Advertisement
Sign in to follow this  
The C modest god

Static and ctr?

This topic is 4406 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

If I have a static member of a certain class, inside some other class. Will that member's ctr be called? Or do I need to explictly write something like A Parent::meber_name; Like you would do for primitive? Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
You could be asking any of three different things, so you should probably try clarifying your point. Some sample code for what you're trying probably wouldn't hurt.

Share this post


Link to post
Share on other sites
if you mean something like this:


class A { A() {} };
calss B { static A a; };



then i'm pretty sure the constructor will be called.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!