Definition, Meaning & Synonyms

const

keyword
/kÉ’nst/
Definition
A keyword in programming that indicates a variable’s value cannot be changed after it is initialized.
Examples
  • In C++, you can declare a constant integer using ‘const int number = 10;’
  • Using ‘const’ helps prevent accidental changes to the variable’s value.
  • For example, ‘const double PI = 3.14;’ defines PI as a constant that represents the value of pi.
Meaning
In the context of programming, ‘const’ is used to define a constant, which is a fixed value that remains the same throughout the execution of a program.
Synonyms
  • constant
  • immutable
  • fixed value