I am trying to understand how advanced declarations interact. When forward declares a function that takes a typedef'd structure, is there a way to simply force the compiler to accept a previously declared (but not defined) structure as a parameter?
The code I have is:
typedef struct{
int year;
char make[STR_SIZE];
char model[STR_SIZE];
char color[STR_SIZE];
float engineSize;
}automobileType;
void printCarDeets(automobileType *);
What I would like to do:
struct automobileType;
void printCarDeets(automobileType *);
I feel like I'm either missing something really basic, or I don’t understand how the compiler deals with forward declarations of structures.
source
share