In a comment to this answer on the usage of Anonymous enum, Oli Charlesworth states that:
const int is immutable, and may not take up any space, depending on what the compiler chooses to do.
If I declare const int i = 10
, how is that 10
stored if it "may not take up any space"?
Assuming that an int
is 4 bytes, I would presume that at least 4 bytes is reserved to store 10 as a const int
.