malloc syntax
snippet in c

allocate memory c

user7556

// Use malloc to allocate memory
ptr = (castType*) malloc(size);
int *exampl = (int*) malloc(sizeof(int));
// Use calloc to allocate and inizialize n contiguous blocks of memory
ptr = (castType*) calloc(n, size);
char *exampl = (char*) calloc(20, sizeof(char));

how to use malloc in c

user8957

int* a =(int*)malloc(sizeof(int))

C malloc

user252

ptr = (cast-type*)calloc(n, element-size);

how to use malloc in c

user5242

ptr = (castType*) malloc(size);

malloc syntax

user8201

ptr = (cast-type*) malloc(byte-size)