Const (computer programming): Difference between revisions

Content deleted Content added
GreenC bot (talk | contribs)
m Fixed grammar
Tags: Mobile edit Mobile app edit iOS app edit
Line 2:
{{use dmy dates|date=December 2022|cs1-dates=y}}
{{lowercase title}}
In some [[programming language]]s, '''const''' is a [[type qualifier]] (a [[Keyword (computer programming)|keyword]] applied to a [[data type]]) that indicates that the data is read-only. While this can be used to declare [[Constant (computer programming)|constants]], {{mono|const}} in the [[List of C-family programming languages|C family]] of languages differs from similar constructs in other languages in beingthat it is part of the ''type,'' and thus has complicated behavior when combined with [[Pointer (computer programming)|pointers]], references, [[composite data type]]s, and [[type-checking]]. In other languages, the data is not in a single [[memory ___location]], but copied at [[compile time]] on each use.<ref>{{Cite web |title=Constant items - The Rust Reference |url=https://doc.rust-lang.org/reference/items/constant-items.html |access-date=2022-06-22 |website=doc.rust-lang.org}}</ref> Languages which use it include [[C (programming language)|C]], [[C++]], [[D (programming language)|D]], [[JavaScript]], [[Julia (programming language)|Julia]], and [[Rust (programming language)|Rust]].
 
== Introduction ==