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



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. In good form, don't forget to add column headers a
View Tutorial          By: Jake at 2009-07-13 14:20:16

2. really helpfull :) thanks
View Tutorial          By: Jagan at 2014-12-09 10:16:56

3. Thank you so much....
I am going to have ja

View Tutorial          By: Mehrnoosh at 2013-06-09 16:50:23

4. Where is the methods related
View Tutorial          By: Osvaldo F. L. Mendes at 2008-03-17 15:40:48

5. Good example but hard to read. Every other word is
View Tutorial          By: Eugene at 2012-03-28 12:19:44

6. nice one !!! just keep it .. i have learn a lot..
View Tutorial          By: dondon at 2011-07-27 04:43:40

7. Hi, I am new to J2ME and just recently i created a
View Tutorial          By: andre at 2011-08-02 22:57:05

8. Good one.........!!!
View Tutorial          By: Shailesh Nakade at 2012-07-11 09:48:33

9. its cool, you've cleared me.
View Tutorial          By: zealous at 2013-09-10 17:40:26

10. I want to get SCJP certification. please anyone c
View Tutorial          By: Raju Salla at 2012-05-04 08:38:06