April 2018
Intermediate to advanced
222 pages
5h 28m
English
Reference types, unlike value types, do not store their values directly within the variabless themselves. Instead of the value, they store the address of the location where the value is stored. The variable holds the pointer to another memory location that holds the actual data. Reference types are types that can take more than 32 bytes of memory in size. Reference types are shown next, by means of an illustration.
In the following example, an array variable of data type uint is declared with size 6. Arrays in Solidity are based at zero and so this array can hold seven elements. The variable a has memory space allocated by EVM which is referred as 0x123 and this location has a pointer value 0x456 stored in it. This pointer ...