Start here · Essential guide
The const Keyword in C++
Learn what the const keyword does in C++, how it applies to variables, pointers, references and member functions, and how the compiler enforces it.
Syntax and Functions
How const works in C++, the C keyword list and const in JavaScript.
Start here · Essential guide
Learn what the const keyword does in C++, how it applies to variables, pointers, references and member functions, and how the compiler enforces it.
Default to const for values you won't reassign and use let when a value must change. Here is how to choose, and why most modern code avoids var.
C has 32 reserved keywords in the original C89 standard, such as int, if and return. Here is the full list, grouped by purpose, plus later additions.
const and var both declare variables in JavaScript, but they differ in scope, hoisting and reassignment. Here is how each works and when to pick one.
In C++, const marks a value as read-only so the compiler catches accidental changes. Examples cover variables, function parameters and member functions.
Related topics