What is role of static keyword on class member variable in C++?

Trainee Asked on August 15, 2019 in C++ Language.
Add Comment
1 Answer(s)

A static variable does exit though the objects for the respective class are not created. Static member variable share a common memory across all the objects created for the respective class. A static member variable can be referred using the class name itself.

Supporter Answered on August 15, 2019.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.