Difference between structure data type and elementary dara type
Answers
Answer:
elementary data types
Basic differences among programming languages:
types of data allowed
types of operations available
mechanisms for controlling the sequence of operations
Elementary data types: built upon the available hardware features
Structured data types: software simulated
Data objects, variables, and constants
1. 1. Data object:
a run-time grouping of one or more pieces of data in a virtual computer.
a location in memory with an assigned name in the actual computer.
Types of data objects:
Programmer defined data objects - variables, arrays, constants, files, etc.
System defined data objects - set up for housekeeping during program execution, not directly accessible by the program. E.g. run-time storage stacks.
Data value: a bit pattern that is recognized by the computer.
Elementary data object: contains a data value that is manipulated as a unit.
Data structure: a combination of data objects.
Attributes: determine how the location may be used. Most important attribute - the data type.
Attributes and Bindings
Type: determines the set of data values that the object may take and the applicable operations.
Name: the binding of a name to a data object.
Component: the binding of a data object to one or more data objects.
Location: the storage location in memory assigned by the system.
Value: the assignment of a bit pattern to a name.
Type, name and component are bound at translation, location is bound at loading, value is bound at execution
1. 2. Data objects in programs
In programs, data objects are represented as variables and constants
Variables: Data objects defined and named by the programmer explicitly.
Constants: a data object with a name that is permanently bound to a value for its lifetime.
Literals: constants whose name is the written representation of their value.
A programmer-defined constant: the name is chosen by the programmer in a definition of the data object.
1. 4. PersistenceData objects are created and exist during the execution of the program. Some data objects exist only while the program is running. They are called transient data objects. Other data objects continue to exist after the program terminates, e.g. data files. They are called persistent data objects. In certain applications, e.g. transaction-based systems the data and the programs coexist practically indefinitely, and they need a mechanism to indicate that an object is persistent. Languages that provide such mechanisms are called persistent languages.
Explanation: