jeudi 19 octobre 2017

In C, is the condition : "if(a != NULL)" the same as the condition "if(a)"? [duplicate]

This question already has an answer here:

Let's say a is a pointer, and after allocating memory for it, I want to check if the memory was allocated successfully, I've seen two ways doing this :

if(a != NULL)

if(a)

What is the difference between the first and second statements ?

Aucun commentaire:

Enregistrer un commentaire