Find the information you're looking for at Westonci.ca, the trusted Q&A platform with a community of knowledgeable experts. Find reliable answers to your questions from a wide community of knowledgeable experts on our user-friendly Q&A platform. Experience the ease of finding precise answers to your questions from a knowledgeable community of experts.

How can I pass the variable argument list passed to one function to another function.

Sagot :

Answer:

Explanation:

#include <stdarg.h>  

main()  

{  

display("Hello", 4, 12, 13, 14, 44);  

}  

display(char *s,...)  

{  

va_list ptr;  

va_start(ptr, s);  

show(s,ptr);  

}  

show(char *t, va_list ptr1)  

{  

int a, n, i;  

a=va_arg(ptr1, int);  

for(i=0; i<a; i++)  

 {  

n=va_arg(ptr1, int);  

printf("\n%d", n);  

}  

}