title: C - Forward declaration for struct and function
body: <p>I'm trying to figure out how exactly forward declarations interact. When forward declaring a function that takes a typedef'd struct, is there a way to just get the compiler to accept a previously forward declared (but not actually defined) struct as a parameter?</p>
  
  <p>The code that I've got working:</p>
  
  <pre><code>typedef struct{
    int year;
    char make[STR_SIZE];
    char model[STR_SIZE];
    char color[STR_SIZE];
    float engineSize;
  }automobileType;
  
  void printCarDeets(automobileType *);
  </code></pre>
  
  <p>What I wish I could do:</p>
  
  <pre><code>struct automobileType;
  void printCarDeets(automobileType *);
  
  //Defining both the struct (with typedef) and the function later
  </code></pre>
  
  <p>I feel like I'm either missing something really basic or not understanding how the compiler deals with forward declarations of structs.</p>