Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ays in C are one means of aggregating scalar data into larger data types. C uses a particularly simple implementation of arrays, and hence the translation into machine code is fairly straightforward. One unusual feature of C is that one can generate pointers to elements within arrays and perform arithmetic with these 3.8. ARRAY ALLOCATION AND ACCESS pointers. These are translated into address computations in assembly code. 143 Optimizing compilers are particularly good at simplifying the address computations used by array indexing. This can make the correspondence between the C code and its translation into machine code somewhat difficult to decipher. 3.8.1 Basic Principles For data type Ì and integer constant Æ , the declaration Ì A[Æ ]; has two effects. First, it allocates a contiguous region of Ä ¡ Æ bytes in memory, where Ä is the size (in bytes) of data type Ì . Let us denote the starting location as ÜA . Second, it introduces an identifier A that can be used as a pointer to th...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online