How does free() know how many bytes to free?

Answer Posted / sekhar

free takes the pointer variable as argument. The intial
data at that location holds a value of number of bytes that
pointer is pointing to. Based on that information, it frees
the memory.

Is This Answer Correct ?    9 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is meant by 'bit masking'?

890


Write a program to reverse a string.

644


In which language linux is written?

607


What is gets() function?

675


Write a code of a general series where the next element is the sum of last k terms.

598






What is c programing language?

618


What are register variables? What are the advantage of using register variables?

690


Why should I use standard library functions instead of writing my own?

678


In c programming language, how many parameters can be passed to a function ?

637


Why we not create function inside function.

1753


How can I write functions that take a variable number of arguments?

631


What is actual argument?

595


What is calloc() function?

627


Define recursion in c.

704


What do you understand by friend-functions? How are they used?

653