title: Self referential structs in c
body: <p>I'm trying to move some code that was compiling fine as C++ in VS2010 to c (gcc c99) and I'm getting compilation errors. It's a little different than the other self-referential struct questions, because I have 2 user defined types, each of which contains pointers to one another. It seems my forward declartions aren't enough.</p>
  
  <pre><code>struct potato; //forward declare both types
  struct tomato;
  
  struct potato
  {
      potato* pPotato; //error: unknown type name ‘potato’
      tomato* pTomato;
  
  };
  
  struct tomato
  {
      potato* pPotato;
      tomato* pTomato;
  };
  </code></pre>
  
  <p>Why does this not work in gcc 99? Why is it ok as C++ code? How should I modify this to get the same behavior as c99?</p>