我正在尝试理解Rust的引用。
fn main() {
let x: i32 = 0;
println!("{}", x+1); // this works
println!("{}", (&x)+1); // this works
//println!("{}", (&(&x))+1); // but this failed
}
我能提供的服务:
1
1
< p > & 隐藏字元 实际上是什么意思?为什么像整数一样可以添加 < code >&x,但无法添加 < code >&(&x)?< /p >
*x
手动取消引用。 - llogiq