I am new to the Rust programming language after having spent a solid year last year in C.
I find there is something to Rust.
I am looking forward to going through “the book” and learning how Rust is similar to C but with more safety features.
I am new to the Rust programming language after having spent a solid year last year in C.
I find there is something to Rust.
I am looking forward to going through “the book” and learning how Rust is similar to C but with more safety features.
When you are coming from C, you might also try to read https://rust-for-c-programmers.com/ instead of the official tutorial books. I have not worked this winter on it, but my feeling is that it is still quite good. Or wait for the third edition of "Programming Rust" by Jim Blandy. Later read "Effective Rust", which is available as a printed book and online.
Thank you I will also check out the book.
I think Rust will be come my 1st equal language along with C.
Can someone point me to where in the edit book out talks about use input?
I might misunderstand your question. But for text input in the terminal typically real_line() is used -- the textual input string can be later converted to other data types like numeric types. The section about the guessing game in the official tutorial books discusses this in detail, see
Use statement and namespacing - Rust for C-Programmers
and for much more detail
Programming a Guessing Game - The Rust Programming Language
For reading input from a file, the "Rust by Example" has examples:
[EDIT]
Or, when you want to read command line arguments, you might refer to the clap crate:
clap::_derive::_tutorial - Rust
Getting started - Command Line Applications in Rust
For reading command line arguments without the help of the clap crate, the official tutorials have also a very detailed example:
An I/O Project: Building a Command Line Program - The Rust Programming Language
Or a summary: