Sign in to follow this  
The C modest god

Static and ctr?

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

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