Hi,
I'd like to have a safer ptr_remove function, so I wrote this code:
void _ptr_remove(void* ptr) {
if (ptr != NULL) {
ptr_remove(ptr);
ptr = NULL;
}
}
Is this the right way to do this?
I'd prefer this as a makro, but the following code gives me a syntax error:
#define _ptr_remove(ptr) if(ptr) { ptr_remove(ptr); ptr=NULL; }
Is there any chance to get it defined as a makro?
Regards,
Pegamode.