What is malloc in c language? | SoloLearn: Learn to code for FREE!

+1

What is malloc in c language?

8/31/2019 10:42:14 AM

Swami Swami

4 Answers

New Answer

+2

Malloc : void *malloc(size_t n) ; This function is used in dynamic memory allocation. It allocates memory from the heap. We can only access the part of allocated memory through a pointer. E.g : int *i = malloc(sizeof(int)) ; *i = 10; free(i);

+2

Here; https://www.geeksforgeeks.org/dynamic-memory-allocation-in-c-using-malloc-calloc-free-and-realloc/

+1

malloc is used to allocate the memory dynamically

0

Can you explain?