Introduction
- What will initialize the list of arguments in stdarg.h header file?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
va_start
- What we can’t place followed by the non-default arguments?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
default arguments
- If we start our function call with default arguments means, what will be proceeding arguments?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
As a rule, the default argument must be followed by default arguments only.
- What is the default return type of a function?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
void
- What is the output of this program?
#include
using namespace std;
int function(int p = 12, int q)
{
int s;
s = p + q;
return s;
}
int main()
{
cout << function(15);
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
We can’t use the user argument in front of the default argument.
Compilation ErrorIn function 'int function(int, int)':
3:9: error: default argument missing for parameter 2 of 'int function(int, int)'