Basic Console Input and Output: Using the `std::io` module
Welcome to our third series! Now that you have a strong foundation in Rust's basic syntax and data types, it's time to start building programs that can interact with the user. In this article, we will explore how to get input from the user and display output to the console using Rust's standard I/O library.
Handling User Input: Parsing Strings
In the previous article, we learned how to get input from the user as a String. However, to build useful applications, we often need to convert that string into a different type, like a number. This process is called parsing. In this article, we'll explore how to parse strings into numbers and handle the potential errors that can occur.