delorie.com/archives/browse.cgi | search |
Date: | Wed, 25 Apr 2001 13:23:52 +0300 (IDT) |
From: | Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> |
X-Sender: | eliz AT is |
To: | Ren <waxweazle69 AT yahoo DOT com> |
cc: | djgpp AT delorie DOT com |
Subject: | Re: Dynamically Allocated Arrays in C |
In-Reply-To: | <iaxF6.15340$ff.107947@news-server.bigpond.net.au> |
Message-ID: | <Pine.SUN.3.91.1010425132132.24985B-100000@is> |
MIME-Version: | 1.0 |
Reply-To: | djgpp AT delorie DOT com |
Errors-To: | nobody AT delorie DOT com |
X-Mailing-List: | djgpp AT delorie DOT com |
X-Unsubscribes-To: | listserv AT delorie DOT com |
On Wed, 25 Apr 2001, Ren wrote: > void freeArray(char **array, int firstDim, int secondDim) > { > int i, j; > > /*for(i = 0; i < secondDim; i ++) > free(array[i][j]); > */ This is wrong: you should say this instead: for (i = 0; i < firstDim; i++) free (array[i]); > But it keeps crashing Where does it crash?
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |