The two statements you used to compare are both debatable.
The compiler may fold compile-time constants into instructions and not allocate memory on the stack at all. It is also possible to combine multiple identical constants into one and place them in the data segment. Making such a decision requires analyzing the complete code, and the factors that affect the decision include more than just define and const.
tldr: Don’t guess the compilation results by looking at the code. The only reliable comparison method is objdump.
The two statements you used to compare are both debatable.
The compiler may fold compile-time constants into instructions and not allocate memory on the stack at all. It is also possible to combine multiple identical constants into one and place them in the data segment. Making such a decision requires analyzing the complete code, and the factors that affect the decision include more than just define and const.
tldr: Don’t guess the compilation results by looking at the code. The only reliable comparison method is objdump.