C++ Language INTERVIEW QUESTION & ANSWERS
86. |
What is friend function? |
|
The function declaration should be preceded by the keyword friend.The function definitions does not use either the keyword or the scope operator ::. The functions that are declared with the keyword friend as friend function.Thus, a friend function is an ordinary function or a member of another class. |
87. |
What is a call by reference? |
|
A function call mechanism that passes arguments to a function by passing the
addresses of the arguments. |
88. |
What is the call by value? |
|
A function call mechanism that passes arguments to a function by passing a copy
of the value of the arguments. |
89. |
What is inheritance? |
|
The mechanism of deriving a new class from an old one is called inheritance.
The old class is referred to as the base class and the new one is called the derived class or
the sub class. |
90. |
What are the types of inheritance? |
|
- Single inheritance
- Multiple inheritance
- Multi level inheritance
- Hierarchical inheritance
- Hybrid inheritance
|