5 static int AddABunchOfInts (__arglist)
9 System.ArgIterator iter = new System.ArgIterator (__arglist);
10 int argCount = iter.GetRemainingCount();
12 for (int i = 0; i < argCount; i++) {
13 System.TypedReference typedRef = iter.GetNextArg();
14 result += (int)TypedReference.ToObject( typedRef );
20 static int AddASecondBunchOfInts (int a, __arglist)
24 System.ArgIterator iter = new System.ArgIterator (__arglist);
25 int argCount = iter.GetRemainingCount();
27 for (int i = 0; i < argCount; i++) {
28 System.TypedReference typedRef = iter.GetNextArg();
29 result += (int)TypedReference.ToObject( typedRef );
35 static int Main (string[] args)
37 int result = AddABunchOfInts (__arglist ( 2, 3, 4 ));
38 Console.WriteLine ("Answer: {0}", result);
43 result = AddASecondBunchOfInts (16, __arglist ( 2, 3, 4 ));
44 Console.WriteLine ("Answer: {0}", result);