Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

static data member

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
I have some trouble with static data members. Please have a look at two class definition below:

class A {
static CPtrList* m_pList;
...
}

class B : public A {
...
}

class C : public A {
...
}

Do all objects of classes B & C have the same instant of CPtrList?
 
Yes they do.
When you create a derived class, she inherits all member functions and member variables from the base class.

In this case you can declare as public the pointer do the CPtrList class.

hope i could help you!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top