rust early experience (a)

 

rust is a no garbage collection system-level programming language.

Next, I will be based on "simple terms rust" and https://kaisery.github.io/trpl-zh-cn/ch03-01-variables-and-mutability.html  to organize and learn rust

rust has a nice package management tools cargo, install it.

 

cargo new  helloworld

fn main() {
    println!("Hello, world!");
}

cargo build in the target directory will see the results of it.

Why can println because the system is automatically inserted use std :: prelude :: *;

print! n some specifications print.

{: O} octal

{: X} hexadecimal

{: X} hex

{: P} Pointer

{: B} Binary

{: E} Science and Technology

{:?} Any value

{: #?} Line breaks and indentation.

 

Print you need.

 

 

 

 

 

  

 

Guess you like

Origin www.cnblogs.com/beckbi/p/11516363.html