Sep 8, 2024
malloc
, calloc
, realloc
, and free
.malloc
void* malloc(size_t size);
int *p = (int*)malloc(sizeof(int));
calloc
malloc
, but more specific.void* calloc(size_t num, size_t size);
int *arr = (int*)calloc(n, sizeof(int));
realloc
void* realloc(void* ptr, size_t new_size);
int *B = (int*)realloc(A, new_size * sizeof(int));
free
malloc
, calloc
, or realloc
.free(pointer);
malloc
and calloc
regarding initialization.