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. two of them are equal and third one is less than b
View Tutorial          By: nani at 2011-10-28 10:55:58

2. hi.. how can i extrate day, month, year from date
View Tutorial          By: avkash at 2010-10-03 05:19:58

3. i did the same thing..but it s nt working.. :(
View Tutorial          By: dEviL at 2008-12-03 10:20:31

4. What is a mean by maintaining the Session State of
View Tutorial          By: Saranya at 2011-05-14 13:17:42

5. Thank you... Helpful :)
View Tutorial          By: Soopy at 2015-03-31 06:24:57

6. This is good for beginners.
View Tutorial          By: sathish at 2011-04-05 11:37:30

7. can you please e mail me a code about hotel reserv
View Tutorial          By: princeton at 2008-09-19 02:32:13

8. Very precisely and simply explained.
View Tutorial          By: Deepak at 2015-01-05 08:37:01

9. This is very helpfull to us.........thnq
View Tutorial          By: lavanya at 2012-03-17 05:43:12

10. Good Luck....
View Tutorial          By: nagarajan at 2011-06-19 03:55:49