Physics, asked by Anonymous, 9 months ago

Define what a Malloc is

Answers

Answered by Anonymous
2

Answer:

hii mate....

In C, the library function malloc is used to allocate a block of memory on the heap. The program accesses this block of memory via a pointer that malloc returns. When the memory is no longer needed, the pointer is passed to free which deallocates the memory so that it can be used for other purposes.

Answered by llRajputll
1

Answer:

“malloc” or “memory allocation” method in C is used to dynamically allocate a single large block of memory with the specified size. It returns a pointer of type void which can be cast into a pointer of any form. For Example: ptr = (int*) malloc(100 * sizeof(int));

Similar questions