Go to the first, previous, next, last section, table of contents.


xmalloc

Syntax

#include <stdlib.h>

void *xmalloc(size_t size);

Description

This function is just like malloc (see section malloc), except that if there is no more memory, it prints an error message and exits.

Return Value

A pointer to the newly allocated memory.

Portability

not ANSI, not POSIX

Example

char *f = xmalloc(100);


Go to the first, previous, next, last section, table of contents.