0 votes
1 view
in Blockchain by (12.8k points)

For example - Arrays with named indexes or hashes. Something like PHP code;

$array = array(

"foo" => "some foo value",

"bar" => "some bar value",);

Thanks

1 Answer

0 votes
by (29.8k points)

There is something similar to what you're looking for it is a type called mapping:

contract MappingExample {
    mapping(address => uint) public balances;

    function update(uint newBalance) {
        balances[msg.sender] = newBalance;
    }
}

you can refer the link below for more details

http://solidity.readthedocs.io/en/develop/types.html#mappings

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...