benefit of void pointer..

Mar 3, 2010 at 1:45pm
hi guys.. wanna ask something..
what're the benefits of using void pointer rather than integer or character pointer?
and in what cases void pointer is preferable to use than intager or character pointer?
thanks.. :)
Mar 3, 2010 at 1:55pm
Every pointer can be converted to a void*. So void* is usually used, when you just need a pointer to some memory, without knowing what is actually behind the pointer.

int* points to an Integer. char* points to a character. Think of void* pointing to "raw memory with unknown type".
Topic archived. No new replies allowed.