24 170 chapter 3 machine level representation of c

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: { int i; char c; char d; int j; }; C. struct P3 { short w[3]; char c[3] }; D. struct P4 { short w[3]; char *c[3] }; E. struct P3 { struct P1 a[2]; struct P2 *p }; 3.11 Putting it Together: Understanding Pointers Pointers are a central feature of the C programming language. They provide a uniform way to provide remote access to data structures. Pointers are a source of confusion for novice programmers, but the underlying concepts are fairly simple. The code in Figure 3.25 lets us illustrate a number of these concepts. ¯ Every pointer has a type. This type indicates what kind of object the pointer points to. In our example code, we see the following pointer types: Pointer Type int * union uni * Object Type int union uni Pointers xp, ip[0], ip[1] up Note in the above table, that we indicate the type of the pointer itself, as well as the type of the object it points to. In general, if the object has type Ì , then the pointer has type *Ì . The special void * type represents a generic poi...
View Full Document

Ask a homework question - tutors are online