struct.h:
#ifndef _STRUCT_H #define _STRUCT_H int i; #endif
#include "struct.h" void main(void) { i = 1; }
You can include a header file which declares an identifier in the source file which defines that identifier; eg,
/* Foo.h */ #ifndef FOO_H_INCLUDED #define FOO_H_INCLUDED extern int foo_var; #endif /* FOO_H_INCLUDED */ /* Foo.c */ #include "Foo.h" int foo_var;