What "const" means

What I understand the keyword “const” to mean, is that any definition with this declaration, is to be considered a “constant” value.

For example if a variable is declared to be constant (const), (const double pi=3.141592), it is to have a value that is assigned once at declaration, and it cannot be changed/reassigned throughout the program.

From what I understand, it is useful to prevent the program from altering key data that is required to be a consistent value throughout the programs runtime.

1 Like

Privacy & Terms