Realloc in C
Realloc in C
Realloc in C
com/reference/cstdlib/realloc/
Search: Go
Not logged in
C++
Information You are using a version without Ads of this website. Please, consider donating:
Tutorials
Reference
Articles [hide]
Forum
function
Reference
C library: realloc <cstdlib>
wctomb 24 else {
functions (non-standard): 25 free (numbers);
itoa 26 puts ("Error (re)allocating memory");
types: 27 exit (1);
div_t 28 }
ldiv_t 29 } while (input!=0);
lldiv_t 30
size_t 31 printf ("Numbers entered: ");
macro constants: 32 for (n=0;n<count;n++) printf ("%d ",numbers[n]);
EXIT_FAILURE 33 free (numbers);
EXIT_SUCCESS 34
MB_CUR_MAX 35 return 0;
NULL }
RAND_MAX
Lenskart - 1st Frame Free The program prompts the user for numbers until a zero character is entered. Each time a new value is introduced the
Get thousands of Stylish
memory block pointed by numbers is increased by the size of an int.
Glasses. 14-Day Money Back.
Data races
Only the storage referenced by ptr and by the returned pointer are modified. No other storage locations are accessed
by the call.
If the function releases or reuses a unit of storage that is reused or released by another allocation or deallocation
function, the functions are synchronized in such a way that the deallocation happens entirely before the next allocation.
Exceptions (C++)
No-throw guarantee: this function never throws exceptions.
See also
free Deallocate memory block (function )
calloc Allocate and zero-initialize array (function )
malloc Allocate memory block (function )