What is dynamic memory allocation example?

ptr = (cast-type*) malloc(byte-size) For Example: ptr = (int*) malloc(100 * sizeof(int)); Since the size of int is 4 bytes, this statement will allocate 400 bytes of memory. And, the pointer ptr holds the address of the first byte in the allocated memory.9 Ara 2021

Sizin İçin Seçtik  What is the static memory allocation in C?

Leave a Reply

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