|
|
Tomás Ó hÉilidhe wrote:
On Mar 19, 3:54 pm, Eric Sosman <Eric.Sos...@xxxxxxx> wrote:
All of this is
well outside the realm of C -- C doesn't even guarantee that
you can convert between data and function pointers meaningfully.
extern void Func(void);
void (*pFunc)(void) = Func;
char unsigned buf[sizeof pFunc];
memcpy(buf,&pFunc,sizeof pFunc);
/* And then back again */
memcpy(&pFunc,buf,sizeof pFunc);
The English language's habit of overloading tokens, when
coupled with its wavering rules of binding strength, sometimes
produce an ambiguity. By "data and function pointers" I did
not mean "{noun:data} and {adjective:function noun:pointers},"
but "{adjective:data} and {adjective:function} {noun:pointers},"
parsing as "(data and function) pointers," not as "data and
(function pointers)." Or, in that tricksy English, "data
pointers and function pointers."
Sorry for the confusion.
--
Eric Sosman
esosman@xxxxxxxxxxxxxxxxxxxx
|
|