Re: free()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You have to zero the memory it before, like I described here:

http://www.wendzel.de/dr.org/libcmle/examples/mem.html

Steffen

On Sun, 27 Sep 2009 00:18:00 +0330
Mohsen Pahlevanzadeh <mohsen@xxxxxxxxxxxxxxxxx> wrote:

> Dear all,
> We are working on C code (not ++),So we must use free instead delete.
> I have following code:
> /////////////////////////////////
>         struct linked_list *p;
> 	p->src="10.0.0.1";
>         free(p);
>         printf ("%s",p->srcip);
> /////////I see in my output 10.0.0.1 
> My question: i drop p pinter, but see it's value, how i kill p with its
> value?
> 
> Yours,
> Mohsen
> 


-- 
Steffen Wendzel
www.wendzel.de

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux