I don't understand why this is outside the bounds of the array? This array is supposed to accept these command line arguments but every time I compile I have been thrown this exception. I am new to programming so this could be obvious.
Code:
public static void Main(string[] args)
{
string[] CommandLine = new string [4];
string configFile = args[0];
string file1 = args[1];
string file2 = args[2];
Console.WriteLine("configfile is " + configFile);
Console.WriteLine("file1 is " + file1);
Console.WriteLine("file2 is " + file2);
Console.Read();
}
Error: Index was outside the bounds of the array.