C++ Interview Question and Answers

86. What are all the operators that cannot be overloaded?
 
  • Direct member access operator
  • De–reference pointer to class member operator.*
  • Scope resolution operator::
  • Conditional operator ?:
  • Sizeof operator sizeof
 
Your Name Your Email-ID
Your Answer
87. Can a function be overloaded based on return types?
  Function signature does not depend on the return type. So overloading cannot be resolved by the return type alone.
 
Your Name Your Email-ID
Your Answer
88. What do you mean by a public member?
 
  • A member declared as public is a public member.
  • It can be accessed freely in a program.
 
Your Name Your Email-ID
Your Answer
89. Is recursion allowed in inline functions?
  The recursion is allowed in inline fucntion but practically, the inline functions and their properties do not remain inside the program. Moreover, the compiler is not sure about the depth of the recursion at the time of compilation.
 
Your Name Your Email-ID
Your Answer
90. What is virtual function?
  A virtual function is a member function that is declared within a base class and redefined by a derived class .To create a virtual function, the function declaration in the base class is preceded by the keyword virtual.
 
Your Name Your Email-ID
Your Answer