Top "Null-pointer" questions

In computing, a null pointer has a value reserved for indicating that the pointer does not refer to a valid object.

Is it safe to delete a NULL pointer?

Is it safe to delete a NULL pointer? And is it a good coding style?

c++ pointers memory-management null-pointer delete-operator
How do we check if a pointer is NULL pointer?

I always think simply if(p != NULL){..} will do the job. But after reading this Stack Overflow question, it seems …

c null-pointer
Can't find @Nullable inside javax.annotation.*

I want use @Nullable annotation to eliminate NullPointerExceptions. I found some tutorials on the net, I noticed that this annotation …

java annotations nullpointerexception nullable null-pointer
Can I use if (pointer) instead of if (pointer != NULL)?

Is it safe to check a pointer to not being NULL by writing simply if(pointer) or do I have …

c++ pointers if-statement null null-pointer
Uninitialized pointers in code

I am learning C++ and I came to know that pointers if left uninitialized could point to random locations in …

c++ pointers null-pointer
What is a void pointer and what is a null pointer?

So I was going through some interview questions and I came across one about void and null pointers, which claims: …

c++ pointers void-pointers null-pointer
Is it guaranteed to be safe to perform memcpy(0,0,0)?

I am not so well-versed in the C standard, so please bear with me. I would like to know if …

c memcpy language-lawyer null-pointer
Calling a method on an uninitialized object (null pointer)

What is the normal behavior in Objective-C if you call a method on an object (pointer) that is nil (maybe …

iphone objective-c initialization null-pointer
Android - Dealing with a Dialog on Screen Orientation change

I am overriding the onCreateDialog and onPrepareDialog methods or the Dialog class. I have followed the example from Reto Meier's …

android dialog screen-orientation null-pointer
Accessing class members on a NULL pointer

I was experimenting with C++ and found the below code as very strange. class Foo{ public: virtual void say_virtual_…

c++ null virtual null-pointer