This preview shows page 1. Sign up to view the full content.
Unformatted text preview: The C data type int can also be preﬁxed by the qualiﬁers long and short, providing integer representations of various sizes. Figure 2.2 shows the number of bytes allocated for various C data types. The exact number depends on both the machine and the compiler. We show two representative cases: a typical 32-bit machine, and the Compaq Alpha architecture, a 64-bit machine targeting high end applications. Most 32-bit machines use the allocations indicated as “typical.” Observe that “short” integers have two-byte allocations, while an unqualiﬁed int is 4 bytes. A “long” integer uses the full word size of the machine. 26 CHAPTER 2. REPRESENTING AND MANIPULATING INFORMATION
C Declaration char short int int long int char * float double Typical 32-bit 1 2 4 4 4 4 8 Compaq Alpha 1 2 4 8 8 4 8 Figure 2.2: Sizes (in Bytes) of C Numeric Data Types. The number of bytes allocated varies with machine and compiler. Figure 2.2 also shows that a pointer (e.g., a variable declared as being of type “char *”) uses the full word size of the machine. Most machines also support two different ﬂoating-point...
View Full Document