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



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. Thank you!
View Tutorial          By: AndrĂ©s at 2014-10-31 08:31:00

2. good example tnq...........
View Tutorial          By: SaidiReddy at 2012-06-09 12:03:09

3. I wanna to name ,subject and marks of every subjec
View Tutorial          By: raveesh yadav at 2012-10-13 19:56:47

4. This is very clear and explains the concepts in a
View Tutorial          By: Reite at 2011-02-18 13:55:07

5. very nice
View Tutorial          By: subbu at 2011-12-03 13:49:32

6. gudeveniing!! plz gave me some project title gor j
View Tutorial          By: ivie at 2012-12-12 11:00:43

7. I'm getting the following error even after several
View Tutorial          By: Joe85 at 2011-03-18 08:58:04

8. more daitlled coding for me
View Tutorial          By: fred at 2008-07-15 05:56:49

9. If I have reliance netconnect connected to my lapt
View Tutorial          By: Shaik Allabakash at 2010-02-09 19:38:10

10. Thanks for this explanation. I'm not sure whether
View Tutorial          By: Venkatesh Challa at 2013-03-29 04:35:21