Arrays
// Array with a fixed length of 2 elements:
uint[2] fixedArray;
// another fixed Array, can contain 5 strings:
string[5] stringArray;
// a dynamic Array - has no fixed size, can keep growing:
uint[] dynamicArray;People[] public people; // dynamic Array, we can keep adding to itPublic Arrays
struct People {
uint age;
string name;
}
People[] public people;Working with Arrays
Example
Examples - Removing array element
Last updated