If a class inherits a base class with a static variable member, it will be their only member that shares with all inheritance classes.
I have several types inheriting classes, and many instances of each of them. I want each of the inheritance classes to have a separate static member that shares with all its instances.
How can I do that?
thank you and sorry for my bad english.
edit:
class a{ static int var;}; class b::a{}; class c::a{};
Now I want all instances of b to have the same var, and all instances of c to have the same var, but var b will be different from var c.
I regret my English, if you can correct me, please do so.
source share