Can anyone explian to me why is there member function in c++?Is it because it would be easier to call functions for variables of the same type?
Can anyone explian to me why is there member function in c++?Is it because it would be easier to call functions for variables of the same type?
Just considering a class that is neither a derived class nor intended to be a base class: member functions in C++ are intended to access the implementation detail of the class, which generally means the private member variables of the class. This way, if the private member variables change, only the member functions need to be updated, at least in theory.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)