-
-
Save RandyMcMillan/17ee4de8f99f9b3945f3e6f405bacfc8 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn random() { | |
let num1 = vec![2, 3]; | |
let num2 = vec![2, 3]; | |
let address1 = &num1 as *const Vec<i32>; | |
let address2 = &num2 as *const Vec<i32>; | |
let number1 = address1 as i32; | |
let number2 = address2 as i32; | |
println!("{}", number1 % 13); | |
println!("{}", number2 % 13); | |
} | |
fn main() { | |
random(); | |
let num1 = vec![2, 3]; | |
let num2 = vec![2, 3]; | |
let address1 = &num1 as *const Vec<i32>; | |
let address2 = &num2 as *const Vec<i32>; | |
let number1 = address1 as i32; | |
let number2 = address2 as i32; | |
println!("{}", number1 % 13); | |
println!("{}", number2 % 13); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment