title: Object reference for non-static field in c#
body: <p>I had created a function in c# as:</p>
  
  <pre><code>public void input_fields(int init_xcor, int init_ycor, char init_pos, string input)
  {
      char curr_position = 'n';           
      foreach (char c in input)
      {           
          if (c == 'm')
          {
              Move mv = new Move();
              if (curr_position == 'e' || curr_position == 'w')
              {
                  init_xcor = mv.Move_Step(curr_position, init_xcor, init_ycor);
              }
              else
              {
                  init_ycor = mv.Move_Step(curr_position, init_xcor, init_ycor);
              }
          }
      }
  }
  </code></pre>
  
  <p>and I am calling the function as:</p>
  
  <pre><code>input_fields(init_xcor, init_ycor, init_pos, input);
  </code></pre>
  
  <p>but while calling it is giving an error:</p>
  
  <blockquote>
    <p>An object reference is required for
    the non-static field, method, or
    property
    'TestProject.Program.input_fields(int,
    int, char,
    string)'  xxx\TestProject\Program.cs  23  17  TestProject</p>
  </blockquote>
  
  <p>I don't want to make the function static as I have to do an unit test also..</p>
  
  <p>What should I do for this? ... 
  Please help me out.</p>