-
Rust연습-Shadowing코딩Coding/Rust연습 2021. 5. 8. 09:35728x90
Shadowing
fn main() { // The first binding is created with the name "number" let number = 5; // A different binding shadows the name "number" let number = number + 5; // Again, another new binding is created let number = number * 2; println!("The number is {}.", number); }
결과
https://docs.microsoft.com/en-us/learn/modules/rust-understand-common-concepts/2-variables▷ 다른글 보기 ◁
★★★Rust Toturial 로드맵(Road Map)첫시작!-★★★(총정리)Rustacean이 되어 보자!!Let's go! (tistory.com)
반응형'코딩Coding > Rust연습' 카테고리의 다른 글
Rust연습_Booleans-bool 형식 (0) 2021.05.08 Rust연습_문자 및 문자열출력Character and strings (0) 2021.05.08 Rust연습_ The default type is f64. On modern CPUs, the f64 type is roughly the same speed as the f32 type, but it has more precision. (0) 2021.05.08 Rust연습_문자열을 숫자로 변환해야 하고 .parse() 메서드를 사용 (0) 2021.05.08 Rust연습-Mutability_ In Rust, variable bindings are immutable by default. (0) 2021.05.08 Rust연습_데이터 형식 알아보기(u32, i32..) (0) 2021.05.08 Rust연습_변수 만들고 출력(Create and use variables) (0) 2021.05.08 Rust연습_탐색기창에서VSCode불러오고TestRust프로젝트만들기(첫문서) (0) 2021.05.08