Let\'s say I have a function that accepts a void (*)(void*)
function pointer for use as a callback:
void do_stuff(void (*callback_fp)(void*), vo
Void pointers are compatible with other types of pointer. It's the backbone of how malloc and the mem functions (memcpy
, memcmp
) work. Typically, in C (Rather than C++) NULL
is a macro defined as ((void *)0)
.
Look at 6.3.2.3 (Item 1) in C99:
A pointer to void may be converted to or from a pointer to any incomplete or object type