Skip to content

Commit

Permalink
Update syntax_concept_01.md
Browse files Browse the repository at this point in the history
  • Loading branch information
pmqtt authored Jan 6, 2025
1 parent 846c5d0 commit f3c9d88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/syntax_concept_01.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fn main() -> i64 {
let ar: [i64; index] = [0; 11]; // An array of size 11, initialized with zeros

while( index < 11){
ar[index as usize] = index * 2; // Example: storing double the index value
ar[index] = index * 2; // Example: storing double the index value
index += 1;
}
return 0;
Expand All @@ -21,7 +21,7 @@ fn main() -> i64 {
1. **Function `main`**: The main function returns a value of type `i64`, indicating a clear return type definition.
2. **Variable `index`**: Initialized with the value `0`. The type `i64` suggests an integer variable with a large range.
3. **Constant `b`**: Holds the string "Hallo World". This defines a constant value that cannot be changed.
4. **Array `ar`**: A fixed-size array of size `index`, initialized with zeros. This demonstrates dynamic array sizing and indexing.
4. **Array `ar`**: A fixed-size array of size `11`, initialized with zeros.
5. **Loop**: A simple `while` loop that runs until `index` reaches the value `11`, updating the array `ar` with calculated values.
6. **Return Value**: The function ends with a return value of `0`, which typically indicates successful execution.

Expand Down

0 comments on commit f3c9d88

Please sign in to comment.