// plain
A null pointer in Rust is a pointer that does not point to any valid object. It is represented by the type std::ptr::null()
. It is used to indicate that a pointer is not pointing to a valid object.
let ptr: *const i32 = std::ptr::null();
ptr: *const i32 = 0x0
let ptr: *const i32
: declares a pointerptr
of type*const i32
std::ptr::null()
: returns a null pointer of type*const T
group: rust-null