Hello!
What is the best method to declare some variables global ( more than one .C File should know it ) and still avoid multiple public definitions?
A Global Header File is definitely NOT the key to success ;-)
Thanks for your help!
myinclude.h
#ifndef _MYINCLUDE_H #define _MYINCLUDE_H #ifdef MAIN #define EXTERN #else #define EXTERN extern #endif EXTERN int my_variable; #endif _MYINCLUDE_H
main.c
#define MAIN #include "myinclude.h" ...
other.c
#include "myinclude.h" ...