23.01 Variables and Data Types

Variables and Data Types

Overview

Rust provides strong static typing and allows variable declarations with or without mutability.

Topics

Examples

let x = 5; // Immutable
let mut y = 10; // Mutable
y += 5;

let tuple: (i32, f64, char) = (42, 3.14, 'a');
let array: [i32; 3] = [1, 2, 3];

Tags

#rust #variables #datatypes