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

Answer Posted / sourisengupta

free(ptr);

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. According to the information, it
frees
the memory.

Is This Answer Correct ?    4 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is floating point constants?

695


When should a type cast not be used?

628


What is a const pointer?

640


Explain how can you restore a redirected standard stream?

594


How arrays can be passed to a user defined function

581






Implement bit Array in C.

680


Differentiate between Macro and ordinary definition.

734


Explain about block scope in c?

664


What are the 5 data types?

607


Why do we use int main instead of void main in c?

626


Explain what are linked list?

628


Explain how do you determine the length of a string value that was stored in a variable?

674


What is the difference between procedural and functional programming?

523


What is difference between && and & in c?

604


Why main is used in c?

594