Chap Functionoverloading, Const, Inhertiance MCQs
Chap Functionoverloading, Const, Inhertiance MCQs
(b) The compiler replace function call with (c) Both a and b
function code (d) None of the above
10. The advantages of inline functions are
(a) Inline functions are compact (c) Very efficient code can be
function calls generated
(b) The size of object code is reduced (d) All the above
11. In which type of functions, the compiler replaces the function call statement with thefunction
code is
(a) Friend function b) Inline function c) Function overloading d) Both a and b
12. In which function category two or more function have same name but different in numberof argument
list and their data type.
(a) Function overloading (b)Inline function
(c) Friend function (d) All the above
13. The inline function cannot include the
(a) goto statement (b) looping (c) Recursive function body (d) all the above
14. The keyword to create the inline function is
(a) Friend (b) private (c) Class (d) inline
15. The friend function means
(a) A short function
(b) run little faster
(c) can access private and protected members outside the class.
(d) Both a and b
16. Using friend function members are accessed using following syntax
(a) Objectname.membername (c) Only membername
(b) Only object name (d) All the above
17. While defining friend function it does not use either keryword or __operator.
(a) & or . (b) friend or :: (c) objectname.membername or objectname (d) all theabove
18. How to accesses the member of the friend function
(a) Member are accessed directly using member names
(b) Specifying objectname.membername
(c) Any above method
(d) All the above methods
19. The friend function declaration in the class is of
(a) Only public scope
(b) Only private scope
(c) Only Protected scope
(d) Can be any scope in the class (private, protected, public)
20. A friend function is a of a class
(a) Non member function (c) Inline function
(b) Private function (d) Public function of a class