Define what a Malloc is
Answers
Answered by
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
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
English,
5 months ago
Accountancy,
5 months ago
English,
5 months ago
Political Science,
9 months ago
Science,
9 months ago
Math,
1 year ago
Physics,
1 year ago