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 the use of function overloading in C?

671


Which is better malloc or calloc?

645


why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above

638


How can you access memory located at a certain address?

661


What is the acronym for ansi?

622






What is the difference between NULL and NUL?

721


How do you initialize pointer variables?

603


How do I copy files?

619


What extern c means?

529


Suggesting that there can be 62 seconds in a minute?

592


How do you search data in a data file using random access method?

825


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

1998


What is a method in c?

618


what is use of malloc and calloc?

1376


Stimulate calculator using Switch-case-default statement for two numbers

2442