A related area involves overloaded function names. The compiler decides which function should be called by checking the types of the parameters to the function call. If you are a C programmer, think of a class as an extension of the struct type. A struct contains predefined data types, for example, char or int , and might also contain other struct types. Operators with such extra definitions are called overloaded operators .
Member functions exist to operate on members of the class.
Nonmember functions must be declared friend functions if they need to access private or protected members of the class directly. You can specify the level of access for a class member using the public , private , and protected member access specifiers . Public members are available to all functions in the program. Private members are available only to member functions and friend functions of the class. Protected members are available only to members and friends of the base class and members and friends of derived classes.