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.

When does invoking a member function on a null instance result in undefined behavior?

Consider the following code: #include <iostream> struct foo { // (a): void bar() { std::cout << "gman was here" &…

c++ undefined-behavior language-lawyer standards-compliance null-pointer
What is the overhead of Rust's Option type?

In Rust, references can never be null, so in case where you actually need null, such as a linked list, …

performance rust null-pointer
Can using 0L to initialize a pointer in C++ cause problems?

In this question an initializer is used to set a pointer to null. Instead of using value of 0 value of 0…

c++ pointers null-pointer
Which of these will create a null pointer?

The standard says that dereferencing the null pointer leads to undefined behaviour. But what is "the null pointer"? In the …

c++ dereference null-pointer
Creating a file using fopen()

I am just creating a basic file handling program. the code is this: #include <stdio.h> int main() { …

c file-handling dev-c++ null-pointer
Is (int *)0 a null pointer?

This could be thought of as an extension to this question (I'm interested in C only, but adding C++ to …

c language-lawyer null-pointer
NULL passed directly to a function expecting a const reference parameter (VC++ 4.2)

I am looking at something that I discovered in an old code base, and I am pretty confused. Here is …

c++ visual-c++ reference null-pointer
Deleting a null pointer

Possible Duplicate: Is there any reason to check for a NULL pointer before deleting? I often see the following in …

c++ delete-operator null-pointer
Why does gorm db.First() panic with "invalid memory address or nil pointer dereference"?

I can't figure out if I've done something silly or if I've found a bug in gorm. While I'm very …

go null-pointer go-gorm