-
What is the output of this program?
#include
#include
using namespace std;
void function(std::string message, ...);
int main()
{
function("InterviewMania", 5, 7, 10, 8, 9);
return 0;
}
void function(std::string message, ...)
{
va_list ptr;
int number;
va_start(ptr, message);
number = va_arg(ptr, int);
number = va_arg(ptr, int);
cout << number;
}
-
- InterviewMania
- 5
- 7
- 8
- Compilation Error
Correct Option: C
In this program, we are moving the pointer to the second value and printing it.