I’m a programming student trying to better understand pointers, one of the things I learned is that you can set a pointer to NULL. My question is, what’s the difference between these two statements? When would each of them return true/false?
if (some_ptr == NULL)
if (*some_ptr == NULL)
Thanks!
The first does a comparison against the address of the variable to null, the second dereferences the pointer, getting the value held at it and compares it against null.