November 2017
Intermediate to advanced
264 pages
5h 45m
English
Ideally, a program should be self-documenting by using descriptive variable names and easy-to-read code, but there are always cases where additional comments about a program's structure or algorithms are needed. Rust follows the C convention and has:
However, the preferred Rust style is to use only the // comment, also for multiple lines, as shown in the following code:
// see Chapter 2/code/comments.rs
fn main() {
// Here starts the execution of the Game.
// We begin with printing a welcome message:
println!("Welcome to the Game!");
}
Use the /* */ comments ...
Read now
Unlock full access