Перейти к основному содержанию
Zoro
Вопросы
Таймер
Резервное копирование
Главная
/
🦀 Rust
/
Вопросы 11
Rust:
What is the difference between let and const in Rust?
🎯
Режим фокуса
11
🦀
Rust
🌱 junior
Снять отметку
What is the difference between let and const in Rust?
let
— variable.
const
— constant.
rust
Копировать
1
let
x
=
5
;
// Variable
2
const
Y
:
i32
=
10
;
// Constant
let
— can be mutable.
const
— always immutable.
let
— runtime.
const
— compile-time.
Больше вопросов по Rust
What is Rust and what is it used for?
What is ownership in Rust?
What is the difference between ownership, borrowing, and references in Rust?
What is the difference between String and &str in Rust?
What is the difference between Vec and Array in Rust?
What is the difference between mut and const in Rust?
What is the difference between String and &str?
Назад к категории Rust