+ 1
What is malloc in c language?
4 Respostas
+ 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);
+ 1
malloc is used to allocate the memory dynamically
0
Can you explain?