Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- let raw = Box::into_raw(vec![1u8, 2, 3].into_boxed_slice()) as *mut u8;
- unsafe {
- for i in 0..3 {
- println!("{}", raw.offset(i).read() as u8);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement