when can realloc fail?
- From: banansol@xxxxxxxxxxxx
- Date: 1 Apr 2007 11:50:05 -0700
Hi,
I just want to get this right.
A call to realloc() will return NULL on error and the original memory
is left untouched,
both when requesting a larger or a smaller size that the original,
right?
But a call to realloc() with size set to zero is equivalent to free(),
with returns void.
Does that mean that a call to realloc() can fail when shinking memory
except when
shrinking it to zero in which case it will always succeed?
Thanks!
.
- Follow-Ups:
- Re: when can realloc fail?
- From: Malcolm McLean
- Re: when can realloc fail?
- From: Barry Schwarz
- Re: when can realloc fail?
- From: santosh
- Re: when can realloc fail?
- From: Eric Sosman
- Re: when can realloc fail?
- Prev by Date: Re: Reading a key inside a loop
- Next by Date: Re: Multi-word #define
- Previous by thread: Multi-word #define
- Next by thread: Re: when can realloc fail?
- Index(es):
Relevant Pages
|