1 /* Contributed by Nicola Pero - Thu Mar 8 16:27:46 CET 2001 */
5 /* Test method with variable number of arguments */
11 /* sum positive numbers; -1 ends the list */
12 + (int) sum: (int)firstNumber, ...;
15 @implementation MathClass
16 + (int) sum: (int)firstNumber, ...
19 int sum = 0, number = 0;
21 va_start (ap, firstNumber);
27 number = va_arg (ap, int);
34 + initialize { return self; }
39 if ([MathClass sum: 1, 2, 3, 4, 5, -1] != 15)