Content-Length: 7211 | pFad | https://doc.rust-lang.org/std/string/../error/../string/../net/../sync/../sync/../ptr/fn.null.html

null in std::ptr - RustSkip to main content

null

Function null 

1.0.0 (const: 1.24.0) · Source
pub const fn null<T>() -> *const T
where T: Thin + ?Sized,
Expand description

Creates a null raw pointer.

This function is equivalent to zero-initializing the pointer: MaybeUninit::<*const T>::zeroed().assume_init(). The resulting pointer has the address 0.

§Examples

use std::ptr;

let p: *const i32 = ptr::null();
assert!(p.is_null());
assert_eq!(p as usize, 0); // this pointer has the address 0








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://doc.rust-lang.org/std/string/../error/../string/../net/../sync/../sync/../ptr/fn.null.html

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy