easy question about free()
- From: "Michael" <michael5139@xxxxxxxxx>
- Date: Fri, 25 Aug 2006 09:40:30 +0800
Hi,
if I have declared:
typedef struct something_big_struct Something_Big;
struct something_big_struct{
<lots of stuff>
Something_Big *a_big_thing;
};
and I allocate some memory:
SomethingBig *bigPtr;
bigPtr = malloc(sizeof(Something_Big));
After I'm finnished with bigPtr do I need to free a_big_thing separately?
ie do I need to free(bigPtr -> a_big_thing) before I free(bigPtr)?
Thanks for your help
Regards
Michael
.
- Follow-Ups:
- Re: easy question about free()
- From: Herbert Rosenau
- Re: easy question about free()
- From: Kevin Handy
- Re: easy question about free()
- From: Robert Gamble
- Re: easy question about free()
- From: Jack Klein
- Re: easy question about free()
- From: Barry Schwarz
- Re: easy question about free()
- Prev by Date: Re: A newbie's code
- Next by Date: Re: Syntax issue
- Previous by thread: Re: SPEC CPU2006 announced
- Next by thread: Re: easy question about free()
- Index(es):
Relevant Pages
|