Advertisement
NLinker

Convert a reference to the integer

Jul 19th, 2019
475
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.18 KB | None | 0 0
  1. // By Denis
  2.  
  3. fn main() {
  4.     let i = 10;
  5.     let i_ref = &i;
  6.     let i_ptr = i_ref as *const _;
  7.     let i_ptr_num = i_ptr as usize;
  8.     println!("{:p}, {:x}", i_ref, i_ptr_num);
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement