Skip to content

Commit 4ae1159

Browse files
committed
Add Declaring Variables example
1 parent e76df0a commit 4ae1159

File tree

1 file changed

+2
-1
lines changed
  • C01-ThompsonBook-attempt-01/hello_rust/src

1 file changed

+2
-1
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
fn main() {
2-
println!("Hello, world!");
2+
let x = 5; // Declares an immutable variable 'x' with the value 5
3+
// x = 10; // Error: Cannot assign a new value to an immutable variable
34
}

0 commit comments

Comments
 (0)