when to use malloc code example
Example 1: how to use malloc in c
int* a =(int*)malloc(sizeof(int))
Example 2: how to use malloc in c
ptr = (cast-type*) malloc(byte-size)
Example 3: how to use malloc in c
ptr = (castType*) malloc(size);
int* a =(int*)malloc(sizeof(int))
ptr = (cast-type*) malloc(byte-size)
ptr = (castType*) malloc(size);