Professional Documents
Culture Documents
C++ Notess
C++ Notess
CLASSES IN C++
oop-- encapsulates data and functions into packages called classes.
object-- is a collection of data members and associated member functions.
class is a single unit .
;-this show the termination of class.
::-scope resolution operator.To define member function outside class.
INLINE FUNCTIONS--
this function complier replace function call with corresponding function code but
control not jump to function.
PROTOTYPE OF FUNCTION--
this describe the function interface to the compiler by giving details such as the
no. and type of arguments and the return values.
RECURSION--
the fuction call itself.
FUNCTION OVERLOADING--
->a function is overloading when same name is given to different function.
->the same function name will be used with different number of parameters and
parameters of different type.
->typically,function overloading is used wherever a different type of a data is to
be dealt with.
FRIEND FUNCTION:--
->this function can use the data class.
->TO ALLOW ACCESS TO PRIVATE OR PROTECTED DATA IN A CLASS FROM OUTSIDE THE CLASS.
->KEYWORD--"FRIEND"
->A FRIEND FUNCTION IS USED FOR ACCESSING THE NON PUBLIC MEMBERS OF A CLASS.
->IS AN ORDINARY FUNCTION OR ANOTHER CLASS.
FRIEND CLASS---
->friend class is a class which is able to access private or protected members of
another class.
->the friend keyword is used during declaration of friend class inside the body or
definition of another class.
->we are passing arguments or parameters has object of another class in function
definition as well as function call of friend class.