Re: malloc realloc and pointers
- From: roberson@xxxxxxxxxxxxxxxxxx (Walter Roberson)
- Date: Thu, 29 Nov 2007 22:14:16 +0000 (UTC)
In article <474F3665.E22FCDA7@xxxxxxxxxxx>,
Kenneth Brody <kenbrody@xxxxxxxxxxx> wrote:
ravi wrote:
int *variable, value;
*((long*)variable)++ = value;
*((long*)variable)++ = value;
*((long*)variable)++ = value;
*((long*)variable)++ = value;
If variable is properly aligned, I believe it's valid.
variable has not been initialized, so it is a dangling pointer.
--
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth
.
- References:
- malloc realloc and pointers
- From: ravi
- Re: malloc realloc and pointers
- From: Kenneth Brody
- malloc realloc and pointers
- Prev by Date: pointer as argument and parameter
- Next by Date: Re: malloc realloc and pointers
- Previous by thread: Re: malloc realloc and pointers
- Next by thread: Re: malloc realloc and pointers
- Index(es):
Relevant Pages
|