Table of Contents        Previous topic       Next topic       

C COMPILER LIBRARY FUNCTIONS->Detailed Descriptions->malloc()


#include <malloc.h>

void *malloc(size_t size);    Allocate a block of memory


size    Bytes required in allocated block


This function allocates a memory block for the user of size bytes.  The first byte of the block is guaranteed to be suitably aligned for the storage of any object.

Return Value

The function returns a pointer pointing to the first byte in the block.

A NULL value is returned if insufficient memory is available.