2.1 Information Storage Flashcards
In binary representations(2 complement) , the most significant bit indicates what
The sign of the number
0 for positive
1 for negative
size of char
8 bit in IA32, 8 bits in x86-64
size of short
16 bit in IA32, 16 bits in x86-64
size of int
32 bit in IA32, 32 bits in x86-64
size of long
32 bit in IA32, 64 bits in x86-64
size of float
32 bit in IA32, 32 bits in x86-64
size of double
64 bit in IA32, 64 bits in x86-64
size of char*
32bit in IA32, 64 bits in x86-64
char *p
p is a pointer to an object of type char
Big Endian
Least Significant byte has HIGHEST address (least significant byte is stored first)
01 23 45 67
Little Endian
Least significant byte has LOWEST address (least significant byte is stored last)
67 45 23 01
When is byte ordering important
When a code is transferred from one machine to another and when inspecting machine level programs
%d
to print a number as signed decimal
%u
to print a number as unsigned decimal
%x
to print a number in hexadecimal format