use of malloc code example
Example 1: how to use malloc in c
int* a =(int*)malloc(sizeof(int))
Example 2: Malloc
ptr = malloc(size); //You dont need to cast
Example 3: how to use malloc in c
ptr = (cast-type*) malloc(byte-size)
int* a =(int*)malloc(sizeof(int))
ptr = malloc(size); //You dont need to cast
ptr = (cast-type*) malloc(byte-size)