Re: Safefree() an array of arrays

2003-08-14 Thread Sisyphus
- Original Message - From: Nick Ing-Simmons [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: XS [EMAIL PROTECTED] Sent: Monday, August 11, 2003 2:19 AM Subject: Re: Safefree() an array of arrays Sisyphus [EMAIL PROTECTED] writes: Hi, I'm building an n x n 2D array. I've declared

Re: Safefree() an array of arrays

2003-08-14 Thread Nick Ing-Simmons
Sisyphus [EMAIL PROTECTED] writes: Hi, I'm building an n x n 2D array. I've declared the structure: int ** aoa; I've allocated the memory: Newz(100, aoa, n, int); Observation you asked for n 'int's there but you are stuffing it with n 'int *'s That should have been Newz(100, aoa, n, int

Safefree() an array of arrays

2003-08-14 Thread Sisyphus
Hi, I'm building an n x n 2D array. I've declared the structure: int ** aoa; I've allocated the memory: Newz(100, aoa, n, int); if(aoa == NULL) croak(Failed to allocate rows); for(i = 0; i n; ++i) { Newz(i, aoa[i], n, int); if(aoa[i] == NULL) croak(Failed to allocate columns); } I've