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!
{{Short description|Data type which allows a program to indirectly access a particular value in memory}} {{About|the general concept in computing|the more specific concept in C++|Reference (C++)}} {{More citations needed|date=November 2010}} In [[computer programming]], a '''reference''' is a value that enables a program to indirectly access a particular [[datum]], such as a [[variable (computer science)|variable]]'s value or a [[record (computer science)|record]], in the [[computer]]'s [[memory (computing)|memory]] or in some other [[Data storage device|storage device]]. The reference is said to '''refer''' to the datum, and accessing the datum is called '''[[Dereference operator|dereferencing]]''' the reference. A reference is distinct from the datum itself. A reference is an [[abstract data type]] and may be implemented in many ways. Typically, a reference refers to data stored in memory on a given system, and its internal value is the [[memory address]] of the data, i.e. a reference is implemented as a [[Pointer (computer programming)|pointer]]. For this reason a reference is often said to "point to" the data. Other implementations include an offset (difference) between the datum's address and some fixed "base" address, an [[array index|index]], or [[identifier]] used in a [[lookup]] operation into an [[Array data structure|array]] or [[table (database)|table]], an operating system [[Handle (computing)|handle]], a [[physical address]] on a storage device, or a network address such as a [[URL]].
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)