-
In the code snippet : SimpleStorage[] public simpleStorageArray; I am unsure as to what the data type of the array is. The term "SimpleStorage" before [] brackets depict the entire contract that was made in the lesson 1 right ? Can a contract be passed as a data type for an array ? Kindly help me clear this doubt. I am confused as to why SimpleStorage is an array's data type. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello @AyuK03 |
Beta Was this translation helpful? Give feedback.
Hello @AyuK03
You are right, in other programming languages the contract is like a Class, so you can create a group of it into an array.
So, you have SimpleStorage contract, and if you create
SimpleStorage[] public simpleStorageArray
you are creating a group of Simple Storage contracts, nice isn't it?