Home / Programming MCQs / C++ MCQs / Question

U

Uday Singh • 7.23K Points
Tutor III

Q. What is the output of this program?

Code:
#include 
    #include 
    using namespace std;
    void function(std::string message, ...);
    int main()
    {
        function("UdayMCQBuddy", 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;
    }
(A) UdayMCQBuddy
(B) 5
(C) 7
(D) 8

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.