Const (computer programming)

In some programming languages, const is a type qualifier (a keyword applied to a data type) that indicates that the data is read-only. While this can be used to declare constants, const in the C family of languages differs from similar constructs in other languages in that it is part of the type, and thus has complicated behavior when combined with pointers, references, composite data types, and type-checking. In other languages, the data is not in a single memory location, but copied at compile time for each use.[1] Languages which use it include C, C++, D, JavaScript, Julia, and Rust.

  1. ^ "Constant items – The Rust Reference". doc.rust-lang.org. Retrieved 2022-06-22.