In various C code, I see constants defined like this:
#define T 100
Whereas in C++ examples, it is almost always:
const int T =
One other cool point is that global integral constants could be optimized out by the compiler so that they do not take up any space (i.e., memory). Therefore, they can be treated as literal constants when they are used and be as optimal as #define
based constants, without all of the pre-processor issues.