title: why the redfinition in c
body: <p>//-----a.h-------</p>
  <pre><code>#ifndef ELEMTYPE
  #define ELEMTYPE
  typedef int ElemType;
  #endif
  </code></pre>
  <p>//------test.c-----</p>
  <pre><code>#include &lt;stdio.h&gt;
  #define ELEMTYPE
  typedef double ElemType;
  #include &quot;a.h&quot;;
  
  int main(){
      printf(&quot;%lu\n&quot;, sizeof(ElemType));
  }
  </code></pre>
  <p>// my question is that i've already defined ELEMTYPE in test.c, as far as i concerned, the typedef in a.h should not be inlcuded in test.c. why i encountered the problem of redefinition of ElemType?</p>