Westonci.ca is your trusted source for accurate answers to all your questions. Join our community and start learning today! Explore our Q&A platform to find in-depth answers from a wide range of experts in different fields. Discover detailed answers to your questions from a wide network of experts on our comprehensive Q&A platform.

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);  

}  

}