Comment on Tutorial - Using free() Function in C By Daniel Malcolm



Comment Added by : Neo

Comment Added at : 2012-04-04 16:21:35

Comment on Tutorial : Using free() Function in C By Daniel Malcolm
Can you tell me what will happen when I use a free function call to release the memory allocated to a memory block on ONE of the MULTIPLE pointers pointing to that memory block, eg

void *ptr1,*ptr2,*ptr3;
ptr1=ptr2=ptr3=malloc(1000);
free(ptr1);

in this case, what will happen if I try to access ptr2 and ptr3, and for that matter, ptr1, before I have assigned NULL to them, and after the above code?


View Tutorial



Ask a Question

Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. Controlling Page Navigation in JSF - Static and Dy
View Tutorial          By: chip at 2010-10-07 05:16:14

2. awesome. thanks for the info
View Tutorial          By: Darren at 2010-05-09 19:55:22

3. For Jaime,

Maybe using JavaScript f

View Tutorial          By: Jair Aviles at 2011-11-22 05:49:05

4. This is Nice start for programmer '
Thanks

View Tutorial          By: Sagar Ikhankar at 2011-07-22 06:12:44

5. heyy dis is not working with me .. plz suggest

View Tutorial          By: sahil at 2012-10-26 11:03:41

6. The program will work only need to change

View Tutorial          By: LEENA NARULA at 2012-06-15 06:45:06

7. i want to know how to read a file inside zipfile.<
View Tutorial          By: iman at 2009-11-26 12:50:21

8. hi..... i m newly in java ,i want to learn about t
View Tutorial          By: ashwini at 2012-08-09 08:01:34

9. Plz catch the exception to make the program comple
View Tutorial          By: Naman at 2013-04-19 06:01:45

10. good one nice
View Tutorial          By: megha at 2011-07-16 15:54:29