If I declare a static constant variable in the header file as follows:
static const int my_variable = 1;
and then include this header in more than one .c file, will the compiler make a new instance for each file or will it be smart enough to see that it is const and make only one instance for all files?
I know I can do this extern and define it in one of the .c files that include this header, but this is what I am trying to do.
c header-files compilation
Michał
source share