I suppose this question was already asked but I couldn't find it. If I use macros instead of constants like this:
#define A 0
#define B (A+1)
#define C (B+A)
then it's guaranteed to be defined in strict order (A then B then C). But what would happen if I use consts instead?
const int A = 0;
const int B = A + 1;
const int C = A + B;
If that's in function scope - it's fine. But what about global scope? As far as I know, order of definition of global variables is not guaranteed. And what about consts?
I think that is the last thing that stops me from using consts instead of macros.
(I'm also curious if there are any differences between C and C++ in this particular matter).
UPD: The question should be like this: what are the differences (if any) between C and C++ in this matter?