vault backup: 2023-11-16 09:27:09

This commit is contained in:
Louis Gallet 2023-11-16 09:27:09 +01:00
parent 09bd948ff7
commit 8e533df7ce
Signed by: lgallet
SSH Key Fingerprint: SHA256:qnW7pk4EoMRR0UftZLZQKSMUImbEFsiruLC7jbCHJAY

View File

@ -3,8 +3,17 @@ An array is a vector in a collection
To declare an array we use :
```csharp
public static void Main() {
int[] vect = new int[4] // Declare a vector of 4 elements
vect[4] = 22;
int[] vect = new int[4] // Declare a vector of 4 elements (from 0 to 3)
vect[3] = 22;
Console.WriteLine($"b = {b}");
Console.WriteLine($"{vect[3]}");
}
```
The result will be:
```bash
b = 0
22
```
We see that an array start from $0$ to $n-1$