| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#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.
| ANSI/ISO C | No |
| POSIX | No |
char *f = xmalloc(100); |