|
From: Gil <gil...@fr...> - 2004-01-10 23:15:17
|
Oooppsss it's not correct ! Sorry.
Correction:
void freeN(void **ptr) {
free(*ptr);
(*ptr) = NULL;
}
-----Original Message-----
From: Gil [mailto:gil...@fr...]
Sent: dimanche 11 janvier 2004 00:13
To: 'dev...@li...'
Subject: Re: [Dev-C++] malloc and free
free(ptr) cannot put ptr to NULL, simply because you don't pass the
address of ptr.
If you would that all you ptr that are freed, are set to NULL. Define a
fonction that do:
void freeN(void **ptr) {
free(*ptr);
ptr = NULL;
}
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004
|