title: C forward declaration for typedef struct
body: <p>I'm trying to forward declare typedef struct wheels.</p>
  
  <pre><code>typedef struct wheels wheels;
  
  typedef struct car {
    float topSpeed;
    wheels w;
  } car;
  
  typedef struct wheels {
    int frontWheels;
    int backWheels;
  } wheels; 
  
  int main() {
    car c = {
      .topSpeed = 255.0,
      .w = {
        .frontWheels = 2,
        .backWheels = 2,
      }
    };
  
    return 0; 
  }
  </code></pre>
  
  <p>This gives me the following errors: </p>
  
  <blockquote>
    <p>error: field ‘w’ has incomplete type wheels w;</p>
    
    <p>error: field name not in record or union initializer .frontWheels = 2</p>
    
    <p>error: field name not in record or union initializer .backWheels = 2</p>
  </blockquote>
  
  <p>I know I can move the entire typedef struct wheels above the typedef struct car and it would work.</p>
  
  <p>How do I forward declare struct wheels correctly?</p>