Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. struct Test {
  2. x : i32,
  3. }
  4.  
  5. impl Test {
  6. fn new() -> Self {
  7. let t = Test {x : 100};
  8. println!("Address of t: {:p}", &t as *const Test); // cast just for clarity
  9. t
  10. }
  11. }
  12.  
  13. fn main() {
  14. let test = Test::new();
  15. println!("Address of test: {:p}", &test as *const Test); // cast just for clarity
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement