When should we use malloc ()?

Both malloc and calloc functions are used for allocation of memory during runtime . Only difference between them is that calloc initializes the memory block allocated with zero while malloc doesn’t initializes them. So suppose you declare a dynamic array using malloc then elements of array will contain garbage value.

Read more

When should we use malloc ()?

Both malloc and calloc functions are used for allocation of memory during runtime . Only difference between them is that calloc initializes the memory block allocated with zero while malloc doesn’t initializes them. So suppose you declare a dynamic array using malloc then elements of array will contain garbage value.

Read more

What is malloc function?

The malloc() function stands for memory allocation, that allocate a block of memory dynamically . It reserves the memory space for a specified size and returns the null pointer, which points to the memory location. malloc() function carries garbage value. The pointer returned is of type void.

Read more

What is malloc function?

The malloc() function stands for memory allocation, that allocate a block of memory dynamically . It reserves the memory space for a specified size and returns the null pointer, which points to the memory location. malloc() function carries garbage value. The pointer returned is of type void.

Read more