Came from CSAPP “Figure 2.4”
| |
- After
typedef unsigned char *byte_pointer;, the typebyte_pointerhas the same functionality ofunsigned char * %starts the format,.2means minimum 2 digits, pad with zeros if needed.start[i]=*(start + i)= $*(start + i \cdot sizeof(byte_pointer)$.- The expression
&xcreates a pointer to the location holding the object indicated by variable x. - The cast
(byte_pointer) &xindicates that whatever type the pointer&xhad before, the program will now reference a pointer to data of typeunsigned char. The casts do not change the actual pointer; they simply direct the comiler to refer to tha data being pointed to according to the new data type.