Re: [Q] about free(ptr)
From: subnet (sunglo_at_katamail.com)
Date: 12/05/04
- Next message: Joe Wright: "Re: Is there a Swap faster than using XOR!!!"
- Previous message: Al Bowers: "Re: malloc stumper"
- In reply to: Keith Thompson: "Re: [Q] about free(ptr)"
- Next in thread: Chris Torek: "Re: [Q] about free(ptr)"
- Reply: Chris Torek: "Re: [Q] about free(ptr)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Joe Wright: "Re: Is there a Swap faster than using XOR!!!"
- Previous message: Al Bowers: "Re: malloc stumper"
- In reply to: Keith Thompson: "Re: [Q] about free(ptr)"
- Next in thread: Chris Torek: "Re: [Q] about free(ptr)"
- Reply: Chris Torek: "Re: [Q] about free(ptr)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]