T
tmp123
Keith said:foo is a static pointer object; it's therefore initialized to NULL.
(Since it's not const, you could mess it up by assigning a value to
foo.)
Both are similar to the common definition of offset(), except that
they use foo rather than a literal 0. Both dereference a null pointer
Sorry, I've not been clear enough. Please, see at init part of the main
function (I repeat it because it has been snipped):
/* init */
int i;
foo=malloc(256);
for(i=0;i<256;i++) ((char *)foo)=i;
Moreover, method 2 doesn't uses pointer substraction.
Kind regards.