What is dynamic memory example?

Example-: int *ptr; ptr=(int *)malloc(8); This allocates 8 contiguous bytes of memory space and the address of first byte is stored in the pointer variable ptr . This space can hold 4 integers. Unlike memory allocated for variables and arrays, dynamically allocated memory has no name associated with it.

Read more