www.delorie.com/djgpp/doc/libc/libc_871.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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.

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.

Return Value

A pointer to the newly allocated memory.

Portability

ANSI/ISO C No
POSIX No

Example

 
char *f = xmalloc(100);


  webmaster     delorie software   privacy  
  Copyright © 2004     Updated Apr 2004