Skip to content

Instantly share code, notes, and snippets.

@RandyMcMillan
Forked from rust-play/playground.rs
Created July 20, 2024 16:10
Show Gist options
  • Save RandyMcMillan/17ee4de8f99f9b3945f3e6f405bacfc8 to your computer and use it in GitHub Desktop.
Save RandyMcMillan/17ee4de8f99f9b3945f3e6f405bacfc8 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
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