Last active: 2 years ago
fn main() {
let mut values = [1, 2];
let p1 = values.as_mut_ptr();
let first_address = p1 as usize;
// println!("{}", std::mem::size_of::<i32>());
let second_address = first_address + 4;
let p2 = second_address as *mut i32;
unsafe {
*p2 += 1;
}
println!("{:?}", values)
}