5 add_em_up (int count
,...)
10 va_start (ap
, count
); /* Initialize the argument list. */
13 for (i
= 0; i
< count
; i
++)
14 sum
+= va_arg (ap
, int); /* Get the next argument value. */
16 va_end (ap
); /* Clean up. */
23 /* This call prints 16. */
24 printf ("%d\n", add_em_up (3, 5, 5, 6));
26 /* This call prints 55. */
27 printf ("%d\n", add_em_up (10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10));