NAME

alloc - allocate C array with error checking


SYNOPSIS

char *alloc(nbytes)


INPUT PARAMETERS

nbytes - integer
      Number of bytes to allocate


DESCRIPTION

        Alloc provides dynamic core allocation (via malloc (3))
        with error checking.
        Alloc returns a pointer to a block of at least nbytes
        characters suitably aligned (after possible pointer coercion)
        for storage of any type of object.


COMMENTS

        In order to allocate an array of floating point numbers, use
        the following command in the calling routine:
                float *x;
                x = (float *) alloc(nx*sizeof(float));
        nx is the number of elements needed in the array.


SEE ALSO

        malloc (3)


DIAGNOSTICS

        Alloc terminates program execution with an appropriate 
        error message if core could not be allocated.


KEYWORDS

alloc malloc memory allocation


LIBRARY

sep