title: Cannot use local variable before it is declared
body: <p>I am trying to create a function but I'm getting an error message.</p>
  
  <pre><code>public int[] genericSearch(int searchWidth, int startingRadius, int width, int height, Bitmap bitmap)
  {
      //Generic function for finding the best path from a certain range
      if (startingRadius == -1)
          startingRadius = bitmap.Height() / 2;
  </code></pre>
  
  <blockquote>
    <p>Cannot use local variable 'startingRadius' before it is declared.</p>
  </blockquote>
  
  <p>The same problem occurs for the bitmap variable as well. Normally in c++ this type of declaration would work; however, I am unsure why it is not working here.</p>