Sign in to follow this  

Static and ctr?

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

This topic is 4163 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this