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
Record (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|Composite data type}} {{More citations needed|date=September 2021}} In [[computer science]], a '''record''' (also called a '''structure''', '''[[struct (C programming language)|struct]]''', or '''[[compound data type]]''') is a composite [[data structure]] {{endash}} a collection of [[Field (computer science)|fields]], possibly of different [[data type]]s, typically fixed in number and sequence.<ref>{{cite book |last1=Felleisen |first1=Matthias |title=How To Design Programs |url=https://archive.org/details/howtodesignprogr00fell_231 |url-access=registration |date=2001 |publisher=MIT Press |isbn=978-0262062183 |pages=[https://archive.org/details/howtodesignprogr00fell_231/page/n528 53], 60 }}</ref> For example, a date could be stored as a record containing a [[Number|numeric]] <var>year</var> field, a <var>month</var> field represented as a string, and a numeric <var>day-of-month</var> field. A circle record might contain a numeric <var>radius</var> and a <var>center</var> that is a <var>point</var> record containing <var>x</var> and <var>y</var> coordinates. Notable applications include the [[programming language]] ''record type'' and for row-based storage, data organized as a sequence of records, such as a [[database table]], [[spreadsheet]] or [[comma-separated values]] (CSV) file. In general, a record type value is stored in [[main memory|memory]] and row-based storage is in [[mass storage]]. A ''record type'' is a [[data type]] that describes such values and variables. Most modern programming languages allow the programmer to define new record types. The definition includes specifying the data type of each field and an [[identifier]] (name or label) by which it can be accessed. In [[type theory]], [[product type]]s (with no field names) are generally preferred due to their simplicity, but proper record types are studied in languages such as [[System F-sub]]. Since type-theoretical records may contain [[first-class function]]-typed fields in addition to data, they can express many features of [[object-oriented programming]].
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)