3 ms·
> So, what’s const for? For all its flaws, C/C++ const is still useful for type safety. Const variables can also be mapped read-only. This gives you hardware
by haberman 7y ago
> So, what’s const for? For all its flaws, C/C++ const is still useful for type safety.
Const variables can also be mapped read-only. This gives you hardware protection against modifications, and also uses less RAM if the const variable is in a shared library (multiple processes can share the same mappings).