title: Conflicting declaration in c++
body: <p>I have a cpp file as follows:</p>
  
  <pre><code>#include &lt;iostream&gt; 
  
  #include "i.h"
  
  using namespace std; 
  
  typedef struct abc{
  int a1;
  int b1;
  } abc_t, *abc;
  
  void fun(abc x){
  cout&lt;&lt;x-&gt;a1;
  }
  
  int main(){
  abc val;
  fun(val);
  return 0;
  }
  </code></pre>
  
  <p>The i.h file :</p>
  
  <pre><code>struct abc;
  
  void fff(struct abc);
  </code></pre>
  
  <p>When I am compiling the code following error occurs:</p>
  
  <pre><code>t.cpp:8: error: conflicting declaration ‘typedef struct abc* abc’
  
  t.cpp:5: error: ‘struct abc’ has a previous declaration as ‘struct abc’
  
  t.cpp: In function ‘void fun(abc)’:
  
  t.cpp:11: error: base operand of ‘-&gt;’ has non-pointer type ‘abc’
  </code></pre>
  
  <p>If I save the cpp file as c file and compile using c compiler then everything works fine.
  What is the issue with c++ compiler?</p>