: C++ Functions
C++ Functions Multiple Choice Questions with Answers and Explanations asked in Programmers Interviews in Various Companies.
1. The signature of a function is its ..... ?
2. What is true about inline functions ?
Answer: B. It's a request to the compiler to make te function inline
3. Which member function of class cannot modify its objects attributes ?
Answer: C. Constant member functions
4. Which of the following parameter passing mechanism is/are supported by C++ but not in C?
Answer: B. Pass by reference
5. Which of the following type of function is an ideal candidate for being declared inline ?
Answer: B. A function that is small and is called frequently
6. One of the disadvantage of pass by reference is that the called function may inadvertently corrupt the called data.This is avoided by ?
Answer: B. declaring the formal parameters constant
7. The library function exit() causes an exit from ?
Answer: D. The program in which it occurs
8. The getche() library function
Answer: A. returns a character when any key is pressed
9. When an argument is passed by reference
Answer: A. a variable is created in function to hold the argument value
Answer: C. make life simpler for programmers