title: user input initialized array example and implicit conversion
body: <p>Is there a way to cast the unhandled exception line so that the "Input string" will be in the "correct" int "format"? I don't remember the work around for this type of incompatible implicit conversion...unhandled exception at statement in first for loop.</p>
  
  <pre><code>public class ArrayTest
      {
          public static void Main()
          {
              // initialize array
              int[] myArray;
              Console.WriteLine("Enter size of an Array");
              int arrayVariable = Convert.ToInt32(Console.ReadLine());
              myArray = new int[arrayVariable];
              Console.WriteLine("Element at index {0}", arrayVariable);
              Console.WriteLine("Enter elements of Array");
              for (int i = 0; i &lt; arrayVariable; i++)
              {
                  myArray[i] = Convert.ToInt32(Console.ReadLine());
              }
              for (int i = 0; i &lt; arrayVariable; i++)// Display Array Elements
              {
                  Console.WriteLine("Element at index {0} {1}: ", i, myArray[i]);
              }
          }
      }
  </code></pre>