if we have private data member that's means we can't access this variabel outside of that class,so why we add static after private? , as I know static mean this var it's class variable and it's mean also we can't acess it's outside the class.
so what you exactly want to know??? do you have any bugs while coding or you are not clear with the concept?
http://www.learncpp.com/cpp-tutorial/811-static-member-variables/ in C++, static member variables of classes are 'shared' among the instances of the class i.e. everytime the variable is referenced by the objects, it is the same variable. Contrast this to non-const non-static member variables of classes. http://ideone.com/YrxNZ
@krithika : I'm not clear with the concept. #agdgdgdwngo : thanks, it's very helpul
Join our real-time social learning platform and learn together with your friends!