Structure: Difference between revisions

From Computer History Wiki
Jump to navigationJump to search
Improve clarity
+alternative term
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''Structures''' are a mechanism available in most [[programming language]]s for creating a named block of associated data values (usually of mixed [[type]]s), effectively an extended type; the elements have individual sub-names. Instances of the structure can then be used in various ways - e.g. by being passed as an [[argument]] to a [[procedure]].
'''Structures''' (sometimes called '''records''') are a mechanism available in most [[programming language]]s for creating a named block of associated data values (usually of mixed [[type]]s), effectively an extended type; the elements have individual sub-names. Instances of the structure can then be used in various ways - e.g. by being passed as an [[argument]] to a [[subroutine]].


One common use is to have an [[array]] of a particular kind of structure; without structures, the [[program]] would have to have N arrays, one for each data item in the structure.
One common use is to have an [[array]] of a particular kind of structure; without structures, the [[program]] would have to have N arrays, one for each data item in the structure.


{{stub}}
{{semi-stub}}
 
[[Category: Software Basics]]

Latest revision as of 14:19, 2 September 2026

Structures (sometimes called records) are a mechanism available in most programming languages for creating a named block of associated data values (usually of mixed types), effectively an extended type; the elements have individual sub-names. Instances of the structure can then be used in various ways - e.g. by being passed as an argument to a subroutine.

One common use is to have an array of a particular kind of structure; without structures, the program would have to have N arrays, one for each data item in the structure.