C
Programming and Technical
Programming
Program
Point out the error if any in the following program (Turbo C).
#include
#include
void display(int num, ...);
int main()
{
display(4, 'A', 'a', 'b', 'c');
return 0;
}
void display(int num, ...)
{
char c; int j;
va_list ptr;
va_start(ptr, num);
for(j=1; j<=num; j++)
{
c = va_arg(ptr, char);
printf("%c", c);
}
}
Options
1) Error: unknown variable ptr
2) Error: Lvalue required for parameter
3) No error and print A a b c
4) No error and print 4 A a b c
Read Solution (Total 1)
-
- argc=argument count
argv=argument vector - 11 years agoHelpfull: Yes(1) No(0)
C Other Question