Programming - C++ Language
You Are Here :: Home > C++ Language > Functions - General Questions
7. |
A virtual function is a member function that expects to be _________ in a derived class.
|
A. |
private |
B.
|
overridden |
C.
|
ignored
|
D.
|
called frequently
|
|
Answer: Option B
Explanation:
|
8. |
Which of the following function prototype is perfectly acceptable?
|
A. |
int Function(int Tmp = Show()); |
B.
|
float Function(int Tmp = Show(int, float)); |
C.
|
Both A and B.
|
D.
|
float = Show(int, float) Function(Tmp);
|
|
Answer: Option A
Explanation:
|
9. |
Which of the following statement is correct?
|
A. |
C++ enables to define functions that take constants as an argument. |
B.
|
We cannot change the argument of the function that that are declared as constant. |
C.
|
Both A and B.
|
D.
|
We cannot use the constant while defining the function.
|
|
Answer: Option C
Explanation:
|
10. |
Which of the following statement is correct?
|
A. |
Overloaded functions can have at most one default argument. |
B.
|
An overloaded function cannot have default argument. |
C.
|
All arguments of an overloaded function can be default.
|
D.
|
A function if overloaded more than once cannot have default argument.
|
|
Answer: Option C
Explanation:
|
11. |
Choose the correct one?
|
A. |
Friend function can access public data members of the class. |
B.
|
Friend function can access protected data members of the class. |
C.
|
Friend function can access private data members of the class.
|
D.
|
All of the above.
|
|
Answer: Option D
Explanation:
|
12. |
Which of the following is not the member of class?
|
A. |
Static function |
B.
|
Friend function |
C.
|
Const function
|
D.
|
Virtual function
|
|
Answer: Option B
Explanation:
|
« prev
next »