🚀Question 194: What is the output?🦀 fn main() { let x = 5; let y = &x; println!("{}", *y + 1); }
2
0
8
1K
1
@code_rusty y takes the barrow the x and while printing value you use *y so it's easy
@code_rusty *y is not needed. Integers behave as if they implement deref. Compiler will deref &T to T when add demands a real type instance