title: From where does the compiler start reading
body: <p>This is a small program :</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main() {
      f();
      system("pause");
  }
  
  void f() {
      static int x = 20 ;
      class tester {
      public :
          tester() {
              cout &lt;&lt; x ;
          }
      } x1;
  }
  </code></pre>
  
  <p>The error that i get here is :<strong>error C3861: 'f': identifier not found</strong></p>
  
  <p>If i place the function <code>f</code> above main I will get the desired output.</p>
  
  <p><strong>Why it is so ?</strong> 
  I was told that program execution begins at <code>main</code>. According to this the code should run in the first case also. </p>
  
  <p><strong>How does the compiler start reading the program?</strong></p>