Re: How to free dynamically allocated array?



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.
.