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 break statement?

623


Is a house a mass structure?

635


Explain null pointer.

615


Explain what is meant by high-order and low-order bytes?

627


How can I write a function analogous to scanf?

647






Compare interpreters and compilers.

633


regarding pointers concept

1564


What is meant by preprocessor in c?

526


‎How to define structures? · ‎

620


Write a program to swap two numbers without using a temporary variable?

601


List the difference between a While & Do While loops?

627


Why can arithmetic operations not be performed on void pointers?

583


Which is better malloc or calloc?

645


Write a program to swap two numbers without using the third variable?

591


Can we initialize extern variable in c?

626