title: Passing Arrays as Parameters in C#
body: <p>I am trying to create a function that accepts 5 integers, holds them in an array and then passes that array back to the main. I have wrestled with it for a couple of hours and read some MSDN docs on it, but it hasn't "clicked". Can someone please shed some light as to what I am doing wrong?
  Errors:
  Not all code paths return a value;
  something about invalid arguments:</p>
  
  <p>Code:</p>
  
  <pre><code>using System;
  using System.IO;
  using System.Text;
  
  namespace ANumArrayAPP
  {
  class Program
  {
      static void Main()
      {
          int[] i = new int[5];
          ReadInNum(i);
  
          for (int a = 0; a &lt; 5; a++)
          {
              Console.Write(a);
          }
      }
  
      static int ReadInNum(int readIn)
      {
          int[] readInn = new int[5];
  
          for (int i = 0; i &lt; 5; i++)
          {
              Console.WriteLine("Please enter an interger");
              readInn[i] = Console.Read();
          }
      }
  }
  </code></pre>
  
  <p>}</p>