you should never actually declare variables in header files because if you have two or more *.c files that include that header file the compiler linker will issue duplicate objects errors (or something like that).
To get around that problem, in header files use the extern keyword, as in bala's example:
extern int itemp;
Then in ONE and only ONE *.c or *.cpp file declare it again but without the extern keyword. This will actually create an instance of the variable.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Offline 21,957 posts
since Aug 2005