How to free dynamically allocated array?
- From: "Markus" <no@xxxxxxxxx>
- Date: Tue, 30 Aug 2005 11:19:25 +0300
Hi,
I have read the FAQ 6.16 on how to dynamically allocate a
two-dimensional array.
I do it like this:
double** A = (double **)malloc(m * sizeof(double *));
for(i = 0; i < m; i++)
A[i] = (double *)malloc(n * sizeof(double));
But how do I free it? I currently have only
free(A);
but I guess it is not enough.
The FAQ is not clear about this.
TIA
markus
.
- Follow-Ups:
- Re: How to free dynamically allocated array?
- From: Default User
- Re: How to free dynamically allocated array?
- From: kernelxu
- Re: How to free dynamically allocated array?
- From: Christopher Benson-Manica
- Re: How to free dynamically allocated array?
- From: Krishanu Debnath
- Re: How to free dynamically allocated array?
- Prev by Date: Re: while (1) vs. for ( ;; )
- Next by Date: Re: while (1) vs. for ( ;; )
- Previous by thread: UnSigned Long
- Next by thread: Re: How to free dynamically allocated array?
- Index(es):
Relevant Pages
|