Re: [Q] about free(ptr)

From: subnet (sunglo_at_katamail.com)
Date: 12/05/04


Date: 5 Dec 2004 05:08:41 -0800

Keith Thompson <kst-u@mib.org> wrote in message news:<lnpt1p7k8r.fsf@nuthaus.mib.org>...

> > my_free(&p);

> It's invalid. You're passing an argument of type int** to a function
> that expects a void**. There's an implicit conversion from int* to
> void*, but not from int** to void**.

You are right of course, haste makes waste. I wrongly extended the "*"
behavior to "**".

I think that line should look

my_free((void **)&p);

(correct me if I'm wrong) but it's ugly anyway :-)

Thanks