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. Everything is running.... But it doesn't send....<
View Tutorial          By: uu at 2009-04-09 18:10:13

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

3. very useful. Thx
View Tutorial          By: reddy at 2015-05-07 09:58:19

4. that's what I've been looking for!!!!!!!!!!!!!!!!!
View Tutorial          By: bibi at 2014-12-28 20:43:56

5. It is very good example to know the concept better
View Tutorial          By: abdulkadir at 2010-01-27 00:56:07

6. clearly explained the pgm logic....
thnx...

View Tutorial          By: Akshaya at 2011-11-24 04:12:36

7. hello all,
i have this error.
Except

View Tutorial          By: daniel at 2012-08-12 18:50:04

8. xml response is :

<?xml version=

View Tutorial          By: Madhu at 2011-06-29 09:47:51

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

10. Thanks for providing that....
View Tutorial          By: Jothimanickam.M at 2013-04-06 07:35:38