Archived

This topic is now archived and is closed to further replies.

Exellon

void** == any type?

Recommended Posts

Soulkeeper    122
I believe void** is a pointer to a pointer of any type.

These are mostly used as return values so that the function called can return any type.

None of this is definitive of course. Just what I see when I use them.

Share this post


Link to post
Share on other sites
Oluseyi    2112
void ** is a pointer to a pointer. Period. To prevent bias towards particular interpretation, it is a void pointer, but since all pointers are pointers, it''s largely syntactic sugar.

You can (and often do/must) cast a pointer from one type to another to obtain the desired semantics. void pointers are also useful for writing functions that must accept pointer addresses to a variety of structures (like almost all Win32 functions seem to do - except they boneheadedly use long pointers instead).

[ GDNet Start Here | GDNet Search Tool | GDNet FAQ ]
[ MS RTFM [MSDN] | SGI STL Docs | Boost ]
[ Google! | Asking Smart Questions | Jargon File ]
Thanks to Kylotan for the idea!

Share this post


Link to post
Share on other sites
GarlandIX    212
IIRC, long pointers are left over from the 16-bit days when they had 16-bit pointers(near pointers or just pointers) and 32-bit pointers(far pointers or long pointers).

------------------------------
BASIC programmers don''t die, they just GOSUB and don''t return.

Share this post


Link to post
Share on other sites