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
Computer Science,
5 months ago
Math,
5 months ago
Hindi,
5 months ago
Political Science,
10 months ago
Science,
10 months ago
Math,
1 year ago
Physics,
1 year ago