Spot The Error
#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); } }
- No error and print 4 A a b c
- Error: unknown variable ptr
- No error and print A a b c
- Error: Lvalue required for parameter
Correct Answer:
No error and print A a b c
need an explanation for this answer? contact us directly to get an explanation for this answer