Ask a Teacher



can i use the private data members in a member function declared in a class when it's definition give outside the class?

Private members ( data and functions) are hidden from the outside world and they implemented the OOP concept data hiding .That is ,these members can only be used by the member functions and friend functions of the class in which they are declared.

Public members can be accessed from outside the class.The keyword public  provides class members the public interface.
 


comments powered by Disqus