Go to the first, previous, next, last section, table of contents.
#include <stdlib.h> void *xmalloc(size_t size);
This function is just like malloc
(see section malloc), except that if
there is no more memory, it prints an error message and exits.
Note that, currently, the header `stdlib.h' does not
declare a prototype for xmalloc
, because many programs declare
its prototype in different and conflicting ways. If you use
xmalloc
in your own code, you might need to provide your own
prototype explicitly.
A pointer to the newly allocated memory.
not ANSI, not POSIX
char *f = xmalloc(100);
Go to the first, previous, next, last section, table of contents.