Re: When to use automatic variables and when to use malloc
- From: richard@xxxxxxxxxxxxxxx (Richard Tobin)
- Date: 20 Feb 2007 23:26:55 GMT
In article <87y7ms1m63.fsf@xxxxxxxxxxxxxxxx>,
Ben Pfaff <blp@xxxxxxxxxxxxxxx> wrote:
What "dangers" of malloc are alleviated by using variable length
arrays? I suspect that forgetting to deallocate the memory block
is the only one.
And unlike malloc(), variable length arrays don't let you recover when
you run out of memory. Of course, nor do any other kind of auto
variable.
-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
.
- References:
- When to use automatic variables and when to use malloc
- From: Jorge Peixoto de Morais Neto
- Re: When to use automatic variables and when to use malloc
- From: Ben Pfaff
- When to use automatic variables and when to use malloc
- Prev by Date: Re: When to use automatic variables and when to use malloc
- Next by Date: Re: When to use automatic variables and when to use malloc
- Previous by thread: Re: When to use automatic variables and when to use malloc
- Next by thread: Re: When to use automatic variables and when to use malloc
- Index(es):
Relevant Pages
|
Loading