Defining member function: – We have two ways to define member function (1) Inside the class and (2) Outside the Class.

Inside the class: – When we have less number of codes for a member function then we usually prefer to define the member function inside the class. The member function defined inside the class is also treated as inline member function.

Outside the class: – When we have larger length of codes for a member function then it’s better to define member function outside the class. For defining member function outside the class we must declare inside the class.

Syntax: – For defining member function outside the class.

                Return_Type Class_Name::Funtion_Name(Parameter)
                {
                _ _ _ _ _
                _ _ _ _ _
                }

 

Advertisements