Arrays
Learn how to use arrays in Solidity.
We'll cover the following...
In the previous chapter, we covered the very basics of smart contract development in Solidity. We looked into the core concepts like methods, fields, and variables, and created a simple smart contract.
In this chapter, we'll focus on expanding our Solidity knowledge. We'll learn about data structures in Solidity, such as arrays, and about Solidity’s control structures. We'll also look into how we can define structs, which provide a means to pack multiple fields into a single variable. We'll then use all these new skills in practice and develop several more sophisticated smart contracts.
Dynamic arrays
We'll start this chapter by learning about arrays in Solidity. As in many other programming languages, an array is a data structure that stores a sequence of elements of the same type. Each element has a numerical position starting from zero.
Solidity has two types of arrays: ...