why we require void func( void ** ) ?
Thanks
Pallav Singh
--
comp.lang.c.moderated - moderation address: cl...@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
Did you think you'd get a different answer here than on comp.std.c?
Your question doesn't make sense; you need to provide some context.
DES
--
Dag-Erling Smørgrav - d...@des.no
I maintain an application consisting of several hundred thousand lines of
code, and the construct "void func( void ** )" doesn't appear once.
Now, as to why _you_ may require it, I have no idea. Perhaps if you were to
include some context to your question, we might be able to help.
--
Kenneth Brody
Well, after all "pointer to pointer" is not the same as "pointer to
anything".
If you say
char array[1];
func(array);
then you'll get a warning from gcc (if you requested such warnings).
On the other hand declaration void func(void*) would eliminate this
warning. But if func then would try to save a pointer in the provided
space, then buffer overflow would happen.
--
Minds, like parachutes, function best when open
> Hi
>
> why we require void func( void ** ) ?
>
It's a misunderstanding that if you generically want to pass T**, you would
need void**. No, you still can and should use void*, and within the function
cast to whatever type you need. A void** points to a void*, not to a T* of
any sort.
If you mean something else, please clarify.