Programming in C++

Table of Contents

Constants in C++

Why?

If you know that a value will always be the same, the compiler can use that fact for optimisations. For example — it will always have the same size in memory, so the computer can use that memory for other things.

Two options