Member Functions
Member Functions 1. Defining Member Functions The data members of a class must be declared within the body of the class, whereas member functions of the class can be defined in following ways: · O utside the class definition · Inside the class definition · Outside the Class Definition Member functions that are declared inside a class have to be defined separately outside the class. Their definitions are very much like the normal functions. They should have function header and a function body. An important difference between a member function and a normal function is that a member function incorporates a membership 'identity label' in the header. This label tells the compiler which class the function belongs to. The general form of a member function definition is: return- type class-name :: function-name (argument declara...