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. hey i need a sample program to draw table or grid
View Tutorial          By: pavi at 2012-10-15 04:27:27

2. this work is good
View Tutorial          By: sanath at 2008-12-15 01:18:43

3. This should save some time

class pa

View Tutorial          By: vamsi gude at 2012-03-20 18:27:24

4. HI All,

I am using this code but fo

View Tutorial          By: muna at 2015-07-04 12:28:15

5. Well first-oof, I don't see the obvious app.
View Tutorial          By: Marvin Ambrose at 2010-10-07 01:30:30

6. Thanks for make me understand about the keyword St
View Tutorial          By: Soumya at 2012-09-18 03:30:01

7. its really a good post... very informative..
View Tutorial          By: javagava at 2011-12-13 19:49:08

8. I got the sample and the test working. Thanks a lo
View Tutorial          By: Trishul at 2009-10-26 07:32:57

9. its really helpful.thanks a lot
View Tutorial          By: bena at 2015-03-04 10:39:46

10. thanks a lot
View Tutorial          By: Uzzal biswas at 2014-11-04 02:42:54