Definition | #include <stdlib.h> void *realloc(void *p, size_t n);
| |
Return val. | Pointer to the beginning of the modified memory area | |
if successful. | ||
NULL pointer | if | |
Notes | If If If p is a NULL pointer, If n has the value 0, | |
Example | The following program fragment first requests memory space for 20 characters and then #include <stdlib.h> char *char_array; char_array = (char *)malloc(20 * sizeof(char)); . . char_array = (char *)realloc(char_array, 100 * sizeof(char)); | |
See also | malloc, calloc, free, garbcoll |