va_list(variable list) is user defined data type...
va_list ptr;
=>argument pointer(ptr) traverse through the variable arguments passed in the function...
va_start(ptr,n);
=>points ptr to the argument, in dis case n ie 3
va_arg
=>moves teh ptr to next variable argument
num = va_arg(ptr, int);
so printf print 7...
Siva said:
(Fri, Jan 18, 2013 12:44:17 PM)
We need to declare the pointer *ptr as va_list type because this is variable argument function type.