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. good but very simple program.........
View Tutorial          By: vipul at 2010-03-25 00:33:54

2. Can any help me to get Second line,Second word in
View Tutorial          By: Ramesh at 2012-07-21 11:12:05

3. your second last example in above code (Character
View Tutorial          By: rupam shaw at 2013-04-24 08:36:05

4. Hi guys, What is the best way to connect to mysql
View Tutorial          By: veron at 2010-09-11 16:13:25

5. hi..dud.......
please help me in my proj

View Tutorial          By: amar usakoyal at 2010-05-25 03:31:16

6. where is the main class .
View Tutorial          By: rishi at 2015-10-02 10:17:17

7. good!
View Tutorial          By: rey.ryan at 2009-03-14 05:49:28

8. In case your having trouble

1 the a

View Tutorial          By: Sin at 2013-01-17 05:40:37

9. what about memory in case of struts 2 at a time nu
View Tutorial          By: lakku at 2010-08-13 06:24:02

10. Thanks
View Tutorial          By: Akhilesh at 2010-04-05 11:31:17