Hi All,

Can any one tell me,what is the difference,
if a static data member is defined in public scope of a class declaration
or if it is declared in private scope of a class declartion?

They are stored in the same manner. The difference is that, except for the initial global declaration, the member can only be accessed via a method if it's private and it can be accessed directly if it's public. Just like any other member variable.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.