We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 43b6a26 commit 862babeCopy full SHA for 862babe
README.md
@@ -48,3 +48,4 @@ in a controlled repository now.
48
* `debug-macro-rep.rs`: example of macro with varargs
49
* `macro-nargs.rs`: example of recursive macro
50
* `macro-tt.rs`: macro token tree example
51
+* `nullptr.rs`: null pointer example
nullptr.rs
@@ -0,0 +1,10 @@
1
+fn main() {
2
+ let mut p: * const u32 = std::ptr::null::<u32>();
3
+ println!("{:?}", p);
4
+ println!("{:?}", p.is_null());
5
+ p = p.wrapping_add(1);
6
7
+
8
+ let p: *const u8 = "🦀ello".as_ptr();
9
+ println!("{}", unsafe { (*p) as char });
10
+}
0 commit comments