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.

Sizin İçin Seçtik  Kripto para neden enerji harcar?

Leave a Reply

Your email address will not be published. Required fields are marked *

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.

Sizin İçin Seçtik  How much does it cost to deploy a smart contract on eth?

Leave a Reply

Your email address will not be published. Required fields are marked *