Static member shares copies between objects in a class - Single copy of the static member

Q.  C++: If you have declared a static member in a class, then how many copies of static member are shared between objects?
- Published on 22 Jun 15

a. Separate copy of the static member is created for all objects of the class.
b. Single copy of the static member is shared by all objects of the class.
c. Only static function are shared between objects not variable.
d. None of the above.

ANSWER: Single copy of the static member is shared by all objects of the class.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)