charis guaranteed to hold only 0 to 127, and can be either
char; you cannot assume one or the other. Avoid
charunless you do not care about sign extension.
charcan hold from 0 to 255; it can hold more.
charcan hold from -127 to +127; it can hold more.
shortcan hold from -32,767 to 32,767 (signed) or 0 to 65,535 (unsigned).
intcan hold from -32,767 to 32,767 (signed) or 0 to 65,535 (unsigned). Ints cannot be counted on to hold any more than a short. If you need something larger than a
short, use a
long. If a
shortis big enough, use
intinstead to improve efficiency by taking advantage of a processor's natural word size.
intby casting it to a
short, because that's all you're guaranteed to get.
intdoesn't have a portable representation.
longcan hold from -2,147,483,647 to 2,147,483,647 (signed) or 0 to 4,294,967,295 (unsigned).
floatis a IEEE single-precision number and
doubleis a IEEE double-precision number. This is because the Taligent Application Environment runs only on processors that support the IEEE floating point standard and that support the single- and double-precision types.
float.h. However, remember that the values of these symbols can change from processor to processor or compiler to compiler, within the limits defined above (for more information, see the ANSI/ISO C specification).
In general, watch your assumptions carefully, and use
typedefs instead of C types. For examples, see "Avoid raw C types with dimensions" on page 66.