Next: Reprentation of Signed Integers
Previous: Characters in Memory
When programming, we think of the main memory as a long
sequence of bytes. Bytes are numbered sequentially;
each byte is designated by its number, called the address.
For example, suppose we have a main memory of 4 Gb; there are
bytes in the memory; addresses ranging from
can be represented using 32 bits (binary
digits), or (equiv.) by 8 hexa digits.
Suppose we want to store the string ``john''.
With one character per byte, we need 4 successive memory
locations (bytes) for the string. Each memory location
has an address and a content.
When we declare a variable, the corresponding number of bytes
is reserved in the memory; the name of the variable is just an alias
for the address of the first byte in the storage.