Discussion :: Variable Number of Arguments
-
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 printf("%c", c); } }
|
A.
Error: unknown variable ptr |
|
B.
Error: Lvalue required for parameter |
|
C.
No error and print A a b c |
|
D.
No error and print 4 A a b c |
Answer : Option C
Explanation :
No answer description available for this question.
Be The First To Comment

Whatsapp
Facebook