I'm learning Rust and am trying to add ints and I got this error:
let c = a + b;
| ^
| |
| expected `&str`, found struct `String`
| help: consider borrowing here: `&b`
Here is my code:
use std::io;
fn main() {
let mut a;
let mut b;
io::stdin().read_line(&mut a);
io::stdin().read_line(&mut b);
let c = a + b;
println!("{c}");
}
I think it might be trying to concatenate a and b though I don't know.
I'm trying to add ints and get input from the user in Rust. Though I don't really know how to fix the error.