C Language: free function
(Free Memory Block)
In the C Programming Language, the free function releases a memory block pointed to by ptr.
Syntax
The syntax for the free function in the C Language is:
void free(void *ptr);
Parameters or Arguments
- ptr
- The pointer to the memory block to release.
Note
- The block of memory must have been allocated by one of the following functions - calloc function, malloc function, or realloc function.
Returns
The free function does not return anything.
Required Header
In the C Language, the required header for the free function is:
#include <stdlib.h>
Applies To
In the C Language, the free function can be used in the following versions:
- ANSI/ISO 9899-1990
Similar Functions
Other C functions that are similar to the free function:
Advertisements