Unformatted text preview: lly difﬁcult for novice programmers to understand. For a declaration such as void (*f)(int*);
it helps to read it starting from the inside (starting with “f”) and working outward. Thus, we see that f is a pointer, as indicated by “(*f).” It is a pointer to a function that has a single int * as an argument as indicated by “(*f)(int*).” Finally, we see that it is a pointer to a function that takes an int * as an argument and returns void. The parentheses around *f are required, because otherwise the declaration: void *f(int*);
would be read as: (void *) f(int*);
That is, it would be interpreted as a function prototype, declaring a function f that has an int * as its argument and returns a void *. Kernighan & Ritchie [37, Sect. 5.12] present a very helpful tutorial on reading C declarations. End Our code contains a number of calls to printf, printing some of the pointers (using directive %p) and values. When executed, it generates the following output:
1 2 3 4 5 6 7 8 9 10 ip ip+1 &s.v &...
View Full Document