Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

No, adding 0 to a null pointer will not result in undefined behavior. It will simply return the same null pointer. However, attempting to dereference the null pointer (i.e. access the memory at the address stored in the pointer) will result in undefined behavior.