I want to declare a structure in a header file. When I declare a simple variable in a header file I simply specify the variable as external like this.
The variable in the .c file:
int var;
And the same variable presented in the header file:
extern int var;
So far so good. But what about a struct? If I have the following struct in my .c file
typedef struct
{
unsigned char seconds;
unsigned char minutes;
unsigned char hours;
unsigned char day;
unsigned char month;
union
{
unsigned int year;
unsigned char year_byte[2];
}year_vars;
}time;
How do I declare the structure in the header file?
structureorstructure variable? both are seperate things.