Here ptr and ptr1 are separate va_list,
ptr reads the parameter and displays in char format, and
ptr1 reads the parameter and displays in int format i.e. ASCII of A, B, C, and D.
Priya said:
(Tue, Jul 26, 2011 10:52:11 PM)
I didn get you. Can you please explain more clearly.
Pulkit Aggarwal said:
(Sun, Aug 7, 2011 08:37:55 PM)
The function va_arg() extracts the argument from the argument list and advances the pointer to the next argument .
Here initially c=A and c1=A (but since it is %d therefore its ASCII value is printed).
Can anybody please tell me what's the purpose of this thing in code?
Nuzhat said:
(Tue, Dec 6, 2011 02:43:30 PM)
va_list ptr n prt1 are argument pointer to traverse through the variable arguments passed in the function....
va_start points ptr n ptr1 to the argument...in this case 4...
Vanita said:
(Thu, Feb 9, 2012 11:58:20 AM)
I did not understand this problem. Can anyone explain it briefly?