- [Instructor] Integer types are simple,
primitive data types for representing integer values,
whole numbers with no fractional part.
The integer types include, character, int, short int,
long int and long long int.
These are all available in both signed
and unsigned versions, the size of each will vary
depending on both the architecture and the compiler.
The character type or char type,
is defined as the minimum size necessary
to contain a character.
On most modern systems it's eight bits,
the char type may be signed or unsigned
by default, that is on some systems it may be signed,
and on other systems it may be unsigned.
You cannot count on a char being one or the other,
the only thing you can count on is
that it will hold a character.
All the other integer types are signed,
unless modified with the unsigned modifier.
The short int type is the smallest natural size
of an integer for the target processor,
it may be the same size as an int,
on most modern desktop systems it's 16 bits.
The int type is the natural size of an integer
for the target processor, on most modern desktop systems
it's 32 bits.
Long int is at least the size of an int,
it's often double the size of an int,
on most modern systems it's either 32 or 64 bits.
Long long int, is at least the size of a long int,
it may be double the size of a long int,
on most modern systems it's 64 bits.
For the signed types, the most significant bit
is a signed bit, unsigned types are available
with the unsigned modifier, these are the same size
as their signed types, but they don't set aside
a bit for the sign, if your usage requires an integer
of a specific size, the C standard int header
provides types in these specific widths,
8 bit, 16 bit, 32 bit and 64 bit,
both signed and unsigned.
In the next lesson, we'll look at how integer types vary
in size and range.