| Example App |
|
| What is a macro? |
|
Rust provides a powerful macro system that allows meta-programming macros look like functions except that their name ends with a bang(!) instead of generating a function call, macros are expanded into source code that gets compiled with the rest of the program macros provide more runtime features to a program unlike functions macros are an extended version of functions Using the println! Macro - Syntax
println!(); // prints just a newline
println!("hello "); //prints hello
println!("format {} arguments", "some"); //prints 'format some arguments'
Comments in Rust
Rust supports the following types of comments
|