Data Types
Data Types
Programming Language
Data Types
Assignment operations: =
Parameters Value
E=255 and M 0 An invalid number
E=255 and M = 0
0<E<255 2{E-127}(1.M)
E=0 and M 0 2 {-126}.M
E=0 and M=0 0
Operations
AND, OR, NOT,
Dynamic strings
In Perl, string can be static and dynamic
print ‘$ABC’ will output $ABC
Reference Model: let b refer to 2 and then let c refer to it also. We then pass
these reference to the + operator, and let a refer to the result, namely 4.
Tyically,
the file may be accessed in either
read mode or write mode.
In either mode, there is a file-position
pointer that designates a position before the
first file component, between two components, or
after the last component.
Dr. Zhijiang Dong @ Middle Tennessee State U 52
niversity
Composite Data Types: Files
Operations
Open
Read
Write
End-of-file test
Close
Contiguous array allocation v. row pointers in C. The declaration on the left is a tr ue two-dimensional array. The slashed
boxes are NUL bytes; the shaded areas are holes. The declaration on the right is a ragged array of pointers to arrays of
character s. In both cases, we have omitted bounds in the declaration that can be deduced from the size of the
initializer (aggregate). Both data structures permit individual characters to be accessed using double subscripts, but the
memory layout (and corresponding address arithmetic) is quite different.
All 3 data objects have same L-value and occupy same storage. No
enforcement of type checking.
Poor language design
StartDate:integer);
Hourly:(HourRate:real;
Reg:integer;
Overtime:integer)
end
Basic Operations
Membership: Is data value X a member of set S?
Insertion and deletion of single value
Union, intersection, and difference of sets.