Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Reference (computer science)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Use== References are widely used in [[computer programming|programming]], especially to efficiently pass large or mutable data as [[argument (computer science)|arguments]] to [[subroutine|procedures]], or to share such data among various uses. In particular, a reference may point to a variable or record that contains references to other data. This idea is the basis of [[indirect addressing]] and of many [[linked data structure]]s, such as [[linked list]]s. References increase flexibility in where objects can be stored, how they are allocated, and how they are passed between areas of [[code]]. As long as one can access a reference to the data, one can access the data through it, and the data itself need not be moved. They also make sharing of data between different code areas easier; each keeps a reference to it. References can cause significant complexity in a program, partially due to the possibility of [[dangling reference|dangling]] and [[wild reference]]s and partially because the [[topology]] of data with references is a [[directed graph]], whose analysis can be quite complicated. Nonetheless, references are still simpler to analyze than [[Pointer (computer programming)|pointer]]s due to the absence of [[pointer arithmetic]]. The mechanism of references, if varying in implementation, is a fundamental programming language feature common to nearly all modern programming languages. Even some languages that support no direct use of references have some internal or implicit use. For example, the [[Evaluation strategy|call by reference]] calling convention can be implemented with either explicit or implicit use of references.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)