a) A record may be a collection of non-homogenous data i.e; the data items in a record may have different data types. In case of arrays, data elements are homogenous.
b) The data items in a record are indexed by attribute names, so there may not be a natural ordering of its elements. In arrays, data items are in natural order as they are sequenced by indices.
1. Records are useful for modeling objects that have a number of characteristics. The record data type allows to collect various types of data about an object and to refer to the whole object by a single name. Different attributes or fields are also referred by name.
2. Records are also useful for defining other data structures, allowing programmers to combine information describing characteristics of the structure with the storage of the elements.
No comments:
Post a Comment