title: can somebody explain the outcome of macro (preprocessor) in c (SQUARE(X) X*X why it yields to 49 where x =5 by sending ++x
body: <p>see code below . The output is 49 ( 7*7 = 49) . How this could happen? can somebody explain in details.</p>
  <pre><code>#include &lt;stdio.h&gt;
  #define SQUARE(X) X * X
  #define PR(X) printf(&quot;The result is %d.\n&quot;, X)
  
  int main(void) {
    int x = 5;
    printf(&quot;x = %d\n&quot;, x);
    PR(SQUARE(++x)); // print out 49 but x is 5
  
    return 0;
  }
  </code></pre>