malloc program in c language with pointers code example Example: allocate memory c ptr = (castType*)calloc(n, size);