Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite+ 1
Is zero the same as null?
3 Réponses
+ 6
Null indicates the absence of a value. Zero is just a number.
0
Well, because you put the tag if-statement, yes, there are equal in that sense. In a way, they behave equally when treated them as a bool.
Let me explain.
If you have an if statement with NULL, nullptr or 0 as the statement, they will always be implicitly casted to bool as false.
So,
if(!0 && !NULL && !nullptr) {
// This will always be executed.
}
- 2
zero = number.. can be as index number, etc... null ?? I'm not friends with that😁