In Rust, constants are values that are bound to a name and are not allowed to change. Constants are always immutable and are declared using the const
keyword. They must be annotated with their type, and they can be set only to a constant expression.
In this challenge, you will define and use a constant in Rust. This will help you understand how to declare constants and how they can be utilized in your programs.
MAX_SIZE
with a value of 100
.MAX_SIZE
has the type i32
.MAX_SIZE
from the main
function.const
keyword to define the constant.