I want to have some constant values in my program, for example, I have a constant value TimeLimit in a header which is commonly used in other classes, but I don't know if
#define TimeLimit 30
is more secure than
static const int TimeLimit=30;
Originally I want to use static const because it can cause less compile time when the value is changed, but after consideration of security I suspect if I should #define to improve security.
is it true that #define is more secure than static const because:
"#define" is embedded in compiled code, while static int leaves a variable in memory, which a user can change the value of TimeLimit in memory content easily
If using static const, it is easier for user to know the value of TimeLimit because extracting the value from memory is easier than extracting from compiled code.
is that right?