Question
#include <iostream>
#include <stdarg.h>
using namespace std;
void dumplist(int, ...);
int main()
{
dumplist(2, 4, 8);
dumplist(3, 6, 9, 7);
return 0;
}
void dumplist(int n, ...)
{
va_list p;
int i;
va_start(p, n);
while (n-->0)
{
i = va_arg(p, int);
cout << i;
}
va_end(p);
}
a.
2436
b.
48697
c.
1111111
d.
compile time error
Posted under Object Oriented Programming Using C++
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. What is the output of this program?
Similar Questions
Discover Related MCQs
Q. Which header file should you include if you are to develop a function that can accept variable number of arguments?
View solution
Q. What will initialize the list of arguments in stdarg.h header file?
View solution
Q. To which does the function pointer point to?
View solution
Q. What we will not do with function pointers?
View solution
Q. What is the default calling convention for a compiler in c++?
View solution
Q. What are the mandatory part to present in function pointers?
View solution
Q. which of the following can be passed in function pointers?
View solution
Q. What is meaning of following declaration?
int(*ptr[5])();
View solution
Q. Which keyword is used to define the macros in c++?
View solution
Q. Which symbol is used to declare the preprocessor directives?
View solution
Q. How many types of macros are there in c++?
View solution
Q. What is the mandatory preprosessor directive for c++?
View solution
Q. What is the other name of the macro?
View solution
Q. Which of the following is used to implement the c++ interfaces?
View solution
Q. What is the ability to group some lines of code that can be included
View solution
Q. How many types does functions fall depends on modularization?
View solution
Q. How many types of modularization are there in c++?
View solution
Q. What does the client module import?
View solution
Q. Identify the correct statement.
View solution
Q. What is similar to interface in c++
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Object Oriented Programming Using C++? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!