This preview shows page 1. Sign up to view the full content.
Unformatted text preview: emaining arguments are values to be printed. Within the formatting string, each character sequence starting with ‘%’ indicates how to format the next argument. Typical examples include ‘%d’ to print a decimal integer and ‘%f’ to print a ﬂoating-point number, and ‘%c’ to print a character having the character code given by the argument. End New to C? In function show_bytes (Figure 2.3) we see the close connection between pointers and arrays, as will be discussed in detail in Section 3.8. We see that this function has an argument start of type byte_pointer (which has been deﬁned to be a pointer to unsigned char,) but we see the array reference start[i] on line 9. In C, we can use reference a pointer with array notation, and we can reference arrays with pointer notation. In this example, the reference start[i] indicates that we want to read the byte that is i positions beyond the location pointed to by start. End Procedures show_int, show_float, and show_pointer demonstrate how to use procedure s...
View Full Document
- Spring '10
- The American