What is the initial meaning of the variables of the Ethereum contract?

I am doing contract code with matching data. When I first access the data value, ethereum returns 0 .

Is this the ethereum specification? In other words, can I write a contract under the assumption that the initial value of the variable is 0 ?

+5
source share
1 answer

Yes, this is the default behavior. Each type has a default value of "zero state". For example, boolean has a default value of false, an integer default value of 0, and builds a default value of ""

You can read here http://solidity.readthedocs.io/en/develop/control-structures.html#default-value

+5
source

All Articles