N
Niks
what is a void pointer?
Niks said:what is a void pointer?
Niks said:what is a void pointer?
Victor said:You mean a pointer to void?
A generic pointer, a plain address. That type is returned from 'malloc'
function and from 'operator new', and is accepted by 'operator delete'
as an argument. Usually a pointer to void is used to hold a pointer to
an object of any type or of an unknown type. Has the same alignment
requirements and the same representation as 'char*'. Along with the
requirement that 'void*' can hold a pointer to any object comes the
standard conversion from a pointer to object to a pointer to void. That
conversion is implicit and the reverse can be done using 'static_cast'.
V
Dan said:Can it hold (is it big enough to hold) a pointer to a member function?
I know that the pointers to member functions are implementation
specific, but I was wondering if the standard says anything about this.
Victor said:[...]Dan said:Victor Bazarov wrote:
It says "A void* shall be able to hold any object pointer."
V
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.