Lecture5 Simple C DataT Ypes
Lecture5 Simple C DataT Ypes
1
Fundamental C Data Types [1]
Bits, Bytes and Words
The smallest unit of memory is called a bit.
It can hold one of two values: 0 or 1.
The bit is the basic block of computer memory.
A byte is 8 bits.
A word is a natural unit of memory for a given computer design.
Some computers have 32-bit words and more recent computers have
64-bit words.
The larger a word is the more information it can store.
The concept of types is important in that it determines the space necessary
to store the values of a particular type, and which valid operations are
defined on certain types.
Whenever an identifier, (variable name, function name, formal parameter
name, user-defined type name, etc.) is declared to be of a certain type, the
type name always comes first, followed by the identifier.
<type> <identifier> …
Note Even though a type name may consist of more than one word, it
must still be considered as one autonomous type.
Scalar Types
Scalar types are largest group and are
called scalar because the types have only
one dimension (one value).
There are three sub-groups of scalar
types, namely: arithmetic, pointer and
enumerated types.