7 ms·
> An example of a constant would be a literal, such as "Hello, World!" or 4 or false Not quite, those are literals values. As mentioned in the C++ standards,
by soulbadguy 3y ago
> An example of a constant would be a literal, such as "Hello, World!" or 4 or false
Not quite, those are literals values.
As mentioned in the C++ standards, const-ness is a quality of variables... Not of values.
- teo_zero 3y agoBut that's exactly the criticism: that C++ used the word const for something different from its theoretical meaning, something that could have been better expressed with the word immutable.