#include <stdlib.h> void *malloc(size_t size);
This function allocates a chunk of memory from the heap large enough to
hold any object that is size bytes in length. This memory must be
returned to the heap with free
(see section free).
Note: this version of malloc is designed to reduce memory usage. A faster but less efficient version is available in the libc sources (djlsr*.zip) in src/libc/ansi/stdlib/fmalloc.c
A pointer to the allocated memory, or NULL
if there isn't enough
free memory to satisfy the request.
ANSI, POSIX
char *c = (char *)malloc(100);
Go to the first, previous, next, last section, table of contents.