title: Object Reference Not Set Error on C#
body: <p>I new to Visual C# and just wanted to create a tiny CLI-based application. With the written codes below, I am receiving this error: "Object reference not set to an instance of an object.".
  Obviously, since I'm a noob, I have no idea how fix the problem.</p>
  
  <p>Here's the code I have in Program.cs:</p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          GetAverage(args);
      }
  
      static void GetAverage(string[] s)
      {
          var ave = new Average();
  
          ave.arg = s;
          ave.FindAverage();
          ave.DisplayResult();
      }
  }
  </code></pre>
  
  <p>Here's the code I have in the Average.cs:</p>
  
  <pre><code>public class Average
  {
      public Average()
      {
          Console.Write("\n" + "Given numbers: ");
  
          foreach (string s in this.arg)
          {
              Console.Write(this.arg + " ");
  
              num += Double.Parse(s);
          }
      }
  
      public double num = 0;
      public string[] arg;
      public double result;
  
      public void FindAverage()
      {
          this.result = this.num / this.arg.Length;
      }
  
      public void DisplayResult()
      {
          Console.WriteLine("\n" + "Average: " + this.result);
      }
  }
  </code></pre>
  
  <p>What I wanna do is to access the arguments from Main method of the Program class so that I can work with it from the Average class. </p>
  
  <p>Please help me with this one. Thanks!</p>