A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://doc.rust-lang.org/nightly/std/ptr/fn.null.html below:

null in std::ptr - Rust

std

::

ptr Function null1.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

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4