What is malloc in c language? | Sololearn: Learn to code for FREE!
+ 1

What is malloc in c language?

31st Aug 2019, 10:42 AM
Swami Swami
Swami Swami - avatar
4 Antworten
+ 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);
31st Aug 2019, 10:56 AM
Th├ęophile
Th├ęophile - avatar
+ 1
malloc is used to allocate the memory dynamically
31st Aug 2019, 10:58 AM
­čĹÇ Sandy­čĹÇ
­čĹÇ  Sandy­čĹÇ - avatar
0
Can you explain?
31st Aug 2019, 10:43 AM
Swami Swami
Swami Swami - avatar