Initialize an ArgIterator using a base address.
- arglist
- The argument list, as obtained by the special compiler keyword __arglist.
- ptr
- Overrides the starting address for computing parameters.
Here is an example of a routine that uses the __arglist calling conventions:C# Example
using System; class ArgIteratorDemo { 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 void Main (string[] args) { int result = AddABunchOfInts (__arglist ( 2, 3, 4 )); Console.WriteLine ("Answer: {0}", result); } }
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0