菜鸟提问,,,2,,,马上揭贴
using System;
public class garbage
{
public static void print( params object[] args)
{
int ctr=0;
for ( ctr=0; ctr <= args.Length; ctr++)
{
Console.WriteLine("Argment{0}is:{1}",ctr,args[ctr]);
}
}
}
class MyApp
{
public static void Main()
{
long ALong =123445678567L;
decimal ADec=1234.54M;
byte Abyte=42;
string AString ="Cole McCrary";
Console.WriteLine("First Call.....");
garbage.print(1);
Console.WriteLine("Second Call.....");
garbage.print(123);
Console.WriteLine("\n\n Third Call...");
garbage.print( ALong,ADec,Abyte,AString);
Console.WriteLine("\n\nForth Call....");
garbage.print("binglan","what ","are","jjjjj","name","nide mignI");
}
}
这个小程序,在执行的时候,这句
Console.WriteLine("Argment{0}is:{1}",ctr,args[ctr]);老是有问题,说
Additional information: Index was outside the bounds of the array.
在线等待