Malloc in C

Malloc in C – Allocation a Block of Memory

A block of memory may be allocated using the function malloc in c. The malloc function reserves a block of memory of specified size and returns a pointer of type void. This means that we can assign it to any type of pointer. It takes the following form: ptr = (cast-type *) malloc(byte-size); ptr is

Malloc in C – Allocation a Block of Memory Read More »