mercredi 28 avril 2021

if/else logic using NULL

I'm not sure if I understand the conditionals using = NULL and != NULL.

Is this

if (somethin->example == NULL) 
{
   do task A 
   return;       
}
    
else
{
   do task B
}

the same as this?

if (somethin->example != NULL) 
{        
   do task B  
}
    
else
{  
   do task A
   return;
}

Aucun commentaire:

Enregistrer un commentaire