title: #define causes an "expected primary-expression" error
body: <pre><code>#define N 10;
  
  int main()
  {
      int x;
  
      for (int i=0; i&lt;N; i++)
          x = i;
  
      return 0;
  }
  </code></pre>
  
  <p>Result of compiling this in g++:</p>
  
  <pre><code>test-define.cpp: In function ‘int main()’:
  test-define.cpp:7:22: error: expected primary-expression before ‘;’ token
  test-define.cpp:7:22: error: expected ‘)’ before ‘;’ token
  test-define.cpp:7:24: error: name lookup of ‘i’ changed for ISO ‘for’ scoping [-fpermissive]
  test-define.cpp:7:24: note: (if you use ‘-fpermissive’ G++ will accept your code)
  test-define.cpp:7:27: error: expected ‘;’ before ‘)’ token
  </code></pre>
  
  <p>But it compiles fine when I change line 7 to <code>for (int i=0; i&lt;10; i++)</code>.</p>
  
  <p>Why is this and how can I use the <code>#define</code> directive to accomplish what I want?</p>