Re: How to free dynamically allocated array?
- From: Christopher Benson-Manica <ataru@xxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 30 Aug 2005 12:57:31 +0000 (UTC)
Markus <no@xxxxxxxxx> wrote:
> double** A = (double **)malloc(m * sizeof(double *));
> for(i = 0; i < m; i++)
> A[i] = (double *)malloc(n * sizeof(double));
Those casts are not necessary (see
http://www.eskimo.com/~scs/C-faq/q7.7.html), and if you've forgotten
to include <stdlib.h>, you will not know it. The practice is better
avoided.
--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
.
- References:
- How to free dynamically allocated array?
- From: Markus
- How to free dynamically allocated array?
- Prev by Date: Re: while (1) vs. for ( ;; )
- Next by Date: Re: low-level question
- Previous by thread: Re: How to free dynamically allocated array?
- Next by thread: Re: How to free dynamically allocated array?
- Index(es):