void * and pointers to functions

Stephen Clamage steve at taumet.com
Fri Jul 27 01:12:38 AEST 1990


In article <1990Jul25.213257.7872 at mdivax1.uucp>:

>After reading the relevant parts of K&R II it would appear that a variable of
>type void * may legally contain a pointer to a function as well as a
>pointer to any of the various data types. Is this correct?

No.  ANSI C Standard section 3.2.2.3 says:
"A pointer to void may be converted to or from a pointer to any incomplete
or object type."

An "object" is a data object, not a function.  Function pointers are
everywhere discussed separately.
-- 

Steve Clamage, TauMetric Corp, steve at taumet.com



More information about the Comp.lang.c mailing list