F
Felix Kater
Hi,
if I want to make sure that neither the pointer arg nor the value to
which it points to is NULL: Is solution (a) safe -- or does it have to
be like (b) ?
Felix
void f(int* p){
/* (a) */
if(p==NULL || *p==NULL) return;
/* (b) */
if(p==NULL) return;
if(*p==NULL) return;
}
if I want to make sure that neither the pointer arg nor the value to
which it points to is NULL: Is solution (a) safe -- or does it have to
be like (b) ?
Felix
void f(int* p){
/* (a) */
if(p==NULL || *p==NULL) return;
/* (b) */
if(p==NULL) return;
if(*p==NULL) return;
}