[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: [LI] free...



Hi

 'free' frees the memory you requested from system using malloc or calloc.
The memory is returned to the system free memory pool.
 
 The pointer you pass to free must be pointing to a memory area that was
allocated by malloc or calloc. I don't know what will happen if you pass
NULL to it. Perhaps the call will fail. Definitely they are not the same
thing.

HTH

 Bye
  Shridhar


On Tue, 25 Jan 2000, Arun K Desai wrote:

> Hi all,
> What "free" does???
> Suppose i am having a pointer say *ptr.
> If say free(ptr) what it does???
> If say  ptr=NULL what it does???
> Is it both are same????
> 
>                      Regards,
>                        Arun.
> 

--------------------------------------------------------------------
The Linux India Mailing List Archives are now available.  Please search
the archive at http://lists.linux-india.org/ before posting your question
to avoid repetition and save bandwidth.