I was asked this question in a technical interview:
What is the difference between a
constand a macro in C++?
My a
Another difference is that a const variable has a memory and can be referenced by a pointer. Macro is just the autocomplete that will happen before compilation, hence the name is lost during compiling.
Also macro can be just more than a constant. It can be am expression or anything that is syntactically correct, even a whole definition of a function.
Macros are used to depict programming choices e.g. stack size; while cosnt is used to depict the real world constants like value of Pi or e.