// allocate memory of sizevoid *malloc(size_t size);
//allocates a region of memory, initialized to 0, of size nelements × elementSizevoid *calloc(size_t nelements, size_t elementSize);
// resizes allocated memoryvoid *realloc(void *pointer, size_t size);
// unallocates memory
void free(void *pointer);
Passing non-allocated memory (i.e. not allocated by malloc, calloc, or realloc) to free will result in undefined behavior
No comments:
Post a Comment