forayer said:
A void * pointer isn't a pointer to a void object,
I did not say that it was. There is no such thing as
a `void' object.
its a pointer to any
object. Its just that you dont know what type of object its pointing
to! A discussion on this topic was already carried out in the thread:
"void *malloc(size_t num_bytes);" started by Alawna on Jun 19. (This
particular discussion appears towards the end of the thread). Besides,
what do you mean by 'pointer to void'?
`void' is a type. It happens to be an incomplete type
with the special property that it can never be completed.
Given any type T, complete or incomplete, it is always
possible to derive a new "pointer to T" type denoted `T*'.
(One may eventually encounter compiler limitations on the
number of levels of indirection permitted -- it might not
be possible to use an `int******************************',
for example -- but these are implementation artifacts and
not characteristics of the language.) In particular, there
is a type `void' and so it is possible to derive a "pointer
to `void'" type denoted `void*'.
The Standard contains a few special guarantees about the
`void*' type, and these make it useful as a sort of "type-
blind" pointer. You can't do much with a `void*' as it
stands (you can compare it to other pointer values, but
that's about it), but you can convert it to some other data
pointer type and make use of the converted value (if valid).