title: difference between typedef and define
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1666353/is-typedef-and-define-the-same-in-c">Is typedef and #define the same in c?</a><br>
    <a href="https://stackoverflow.com/questions/5389387/confused-by-define-and-typedef">Confused by #define and typedef</a>  </p>
  </blockquote>
  
  
  
  <p>Is there any difference between the following:</p>
  
  <pre><code>#define NUM int
  
  ...
  
  NUM x;
  x = 5;
  printf("X: %d\n", x);
  </code></pre>
  
  <p>And this:</p>
  
  <pre><code>typedef int NUM;
  
  ...
  
  NUM x;
  x = 5;
  printf("X : %d\n", x);
  </code></pre>
  
  <p>Both tests compile and run without problems. So, are they equivalent?</p>
  
  <p>Thanks. </p>