mercredi 26 août 2015

C - What's the best way for checking if any value is NULL or empty?

I was wondering what was the best (I mean performance and proper) of checking an empty value ?

I know these 2 ways :

First (I think the best) :

For any pointer check : if (value == NULL) ... For an Int : if (value == 0)...


Second : if (value) ...

Thank you in advance!

Aucun commentaire:

Enregistrer un commentaire