| dbpprop:abstract
|
- In computer science, a record (also called tuple or struct) is one of the simplest data structures, consisting of two or more values or variables stored in consecutive memory positions; so that each component (called a field or member of the record) can be accessed by applying different offsets to a single physical address. For example, a date may be stored as a record containing a 16-bit numeric field for the year, a three-letter field for the month, and an 8-bit numeric field for the day-of-month. As this example shows, the fields of a record need not all have the same size and encoding; therefore, in general one cannot easily obtain the field which has a run-time computed index in the field sequence, as one can do in an array. A record type is a data type that describes such values and variables. Most modern computer languages allow the programmer to define new record types. The definition includes specifying the data type of each field, its position in the record, and an identifier (name or label) by which it can be accessed. Records can exist in any storage medium, including main memory and mass storage devices such as magnetic tapes or hard disks. Records are a fundamental component of most data structures, especially linked data structures. Many computer files are organized as arrays of logical records, often grouped into larger physical records or blocks for efficiency. The parameters of a function or procedure can often be viewed as the fields of a record variable; and the arguments passed to that function can be viewed as a record value that gets assigned to that variable at the time of the call. Also, in the call stack that is often used to implement procedure calls, each entry is an activation record or call frame, containing the procedure parameters and local variables, the return address, and other internal fields. An object in object-oriented language is essentially a record that contains procedures specialized to handle that record; and object data types (often called object classes) are an elaboration of record types. Indeed, in most object-oriented languages, records are just special cases of objects. A record can be viewed as the computer analog of a mathematical tuple. In the same vein, a record type can be viewed as the computer language analog of the Cartesian product of two or more mathematical sets, or the implementation of an abstract product type in a specific language.
- Структура або запис - складений тип даних в програмуванні. Структура складається з даних різного типу, з якими зручно працювати, як з єдиним блоком. Наприклад, для обліку різних товарів у магазині потрібно знати їхні найменування, ціни, кількість. Усі ці дані можна записати в одну структуру. Наприклад, на мові С така структура матиме вигляд: struct { char[20] name; double price; int quantity; } A; Структури широко використовуються в структурному програмуванні. В об'єктно-орієнтованому програмуванні поняття структури розширюються до поняття класу - складеного типу даних, який містить не лише самі дані, а й методи їхньої обробки.
|
| rdfs:comment
|
- In computer science, a record (also called tuple or struct) is one of the simplest data structures, consisting of two or more values or variables stored in consecutive memory positions; so that each component (called a field or member of the record) can be accessed by applying different offsets to a single physical address.
- Структура або запис - складений тип даних в програмуванні. Структура складається з даних різного типу, з якими зручно працювати, як з єдиним блоком. Наприклад, для обліку різних товарів у магазині потрібно знати їхні найменування, ціни, кількість.
|