title: Why is there a compile error in this code?
body: <p>I was trying to understand the difference between closures and function pointers, and I came across <a href="https://stackoverflow.com/questions/208835/function-pointers-closures-and-lambda/208940#208940">this answer in SO</a></p>
  <p>What I don't understand is this code</p>
  <pre><code>BOOL (*lessThanTest)(int);
  int lessThan = 100;
  
  lessThanTest = &amp;LessThan;
  
  BOOL LessThan(int i) {
     return i &lt; lessThan; // compile error - lessThan is not in scope
  }
  </code></pre>
  <p>Why there is a compile error consideringn that lessThan is a global variable, it can be accessed from within LessThan function, did I miss something?</p>
  <p><strong>EDIT</strong></p>
  <p>This is not my code, it's taken from an answer in SO <a href="https://stackoverflow.com/questions/208835/function-pointers-closures-and-lambda/208940#208940">Function pointers, Closures, and Lambda</a></p>