Utility Functions and C Language Reference > C Language Reference > Alphabetical List of Functions > malloc


Example: malloc Memory Allocation Functions

Allocates a block of memory.

void *malloc( size_t num_bytes); 

num_bytes The size of the block of memory that is allocated.

Return Values

Returns a void type pointer to the allocated space. If the system could not allocate the requested block of memory or if num_bytes is 0, returns a NULL pointer.

For malloc details, refer to your C language documentation.