Xamarin Public Jenkins (auto-signing) 6bdd276d05 Imported Upstream version 5.0.0.42
Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
2017-04-10 11:41:01 +00:00

31 lines
566 B
C#

using System;
class Class1
{
static int AddABunchOfInts (__arglist)
{
int result = 0;
System.ArgIterator iter = new System.ArgIterator (__arglist);
int argCount = iter.GetRemainingCount();
for (int i = 0; i < argCount; i++) {
System.TypedReference typedRef = iter.GetNextArg();
result += (int)TypedReference.ToObject( typedRef );
}
return result;
}
static int Main (string[] args)
{
int result = AddABunchOfInts ( __arglist ( 2, 3, 4 ));
Console.WriteLine ("Answer: {0}", result);
if (result != 9)
return 1;
return 0;
}
}