A default argument is checked for type at the time of declaration and evaluated at the time of call.
B -
We can provide a default value to a particular argument in the middle of an argument list.
C -
We cannot provide a default value to a particular argument in the middle of an argument list.
D -
Default arguments are useful in situations where some arguments always have the same value.
2-
Which of the following statement is correct?
A -
The default value for an argument cannot be function call.
B -
C++ allows the redefinition of a default parameter.
C -
Both A and B.
D -
C++ does not allow the redefinition of a default parameter.
3-
Which of the following statement is correct?
A -
Only one parameter of a function can be a default parameter.
B -
Minimum one parameter of a function must be a default parameter.
C -
All the parameters of a function can be default parameters.
D -
No parameter of a function can be default.
4-
Where the default value of parameter have to be specified?
A -
Function call
B -
Function definition
C -
Function prototype
D -
Both B or C
5-
Which of the following statement is correct?
A -
Overloaded functions can accept same number of arguments.
B -
Overloaded functions always return value of same data type.
C -
Overloaded functions can accept only same number and same type of arguments.
D -
Overloaded functions can accept only different number and different type of arguments.
6-
Which of the following function / types of function cannot have default parameters?
A -
Member function of class
B -
main()
C -
Member function of structure
D -
Both B and C
7-
Which of the following statement is correct?
A -
The order of the default argument will be right to left.
B -
The order of the default argument will be left to right.
C -
The order of the default argument will be alternate.
D -
The order of the default argument will be random.
8-
Which of the following statement is correct?
A -
A reference is stored on heap.
B -
A reference is stored on stack.
C -
A reference is stored in a queue.
D -
A reference is stored in a binary tree.
9-
Which of the following statements is correct?
1/ Once a reference variable has been defined to refer to a particular variable it can refer to any other variable.
2/ A reference is not a constant pointer.
A -
Only 1 is correct.
B -
Only 2 is correct.
C -
Both 1 and 2 are correct.
D -
Both 1 and 2 are incorrect.
10-
Functions can be declared to return a reference type. There are reasons to make such a declaration/Which of the following reasons are correct?
1/ The information being returned is a large enough object that returning a reference is more efficient than returning a copy.
2/ The type of the function must be a R-value.