Variable Number of Arguments

Q1:
Point out the error in the following program.
#include<stdio.h>
#include<stdarg.h>
void varfun(int n, ...);

int main()
{
    varfun(3, 7, -11.2, 0.66);
    return 0;
}
void varfun(int n, ...)
{
    float *ptr;
    int num;
    va_start(ptr, n);
    num = va_arg(ptr, int);
    printf('%d', num);
}

A Error: too many parameters

B Error: invalid access to list member

C Error: ptr must be type of va_list

D No error

ANS:A - Error: too many parameters

No answer description is available. Let's discuss.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.