April 2017
Intermediate to advanced
266 pages
7h 4m
English
Solidity provides the var keyword to declare variables. The type of the variable in this case is decided dynamically depending on the first value assigned to it. Once a value is assigned, the type is fixed, so if you assign another type to it, it will cause type conversion.
Here is an example to demonstrate var:
int256 x = 12; //y type is int256 var y = x; uint256 z= 9; //exception because implicit conversion not possible y = z;
Read now
Unlock full access