title: How to declare global variables?
body: <p>I have a doubt regarding Memory Management in Variables declaration.</p>
  
  <p>In my class i have around 20 methods, i am using around 50 variables through out my class.</p>
  
  <p>I declared all variables globally at the starting of a class.</p>
  
  <p>Is it the right way of doing? or else which one is better... Using structure or any thing else???</p>
  
  <p>Below am showing a basic example, i need to use optimize my memory.</p>
  
  <pre><code>  class Program
      {
          static  int a, b, c, d;           //----&gt; Here am declaring , i need any other way
          static void Main(string[] args)
          {
              a = 10;
              b = 20;
              c = 30;
              d = 40;
  
              int result = add(a, b, c, d);
              Console.WriteLine(result);
              Console.ReadLine();
          }
          public static int add(int w, int x, int y, int z)
          {
              return w + x + y + z;
          }
      }
  </code></pre>