A subtle difference is that when you use a #define the value is 'baked' into your machine code as a constant, and as such the compiler can optimize much better.
With an "external const int" it is an single actual value stored somewhere in actual memory, will be loaded from memory. In source file that doesn't have access to the constant value the compiler can make no assumptions of what the value could be and has to optimize for the general case.
So:
Code:
// in the .h file
xxtern constant SCREEN_WIDTH;
// in the .c file
int foo(int a) {
return a*SCREEN_WIDTH;
}
vs
Code:
// in the .h file
#define SCREEN_WIDTH 4
// in the .c file
int foo(int a) {
return a*SCREEN_WIDTH;
}
The resulting machine code will be a lot cleaner/faster with #define, as it will not need to access memory can optimize the multiply operation.
I'm not saying that "#define" is better than "const int" (it isn't), but each definitely has uses and maybe a few seconds should be spent thinking which is best for your use-case.