diff options
author | RJ <catalanor0220@gmail.com> | 2016-02-11 00:45:46 +0800 |
---|---|---|
committer | RJ <catalanor0220@gmail.com> | 2016-02-11 00:45:46 +0800 |
commit | 543cc33681dbee987c936e12527eea983df17270 (patch) | |
tree | 3a32a53b4d77b1adbb874c6c5539607523bf02da /docs/frequently-asked-questions.rst | |
parent | fad2d4df222f3fc306eda84a6a3842955541f9d0 (diff) | |
download | dexon-solidity-543cc33681dbee987c936e12527eea983df17270.tar.gz dexon-solidity-543cc33681dbee987c936e12527eea983df17270.tar.zst dexon-solidity-543cc33681dbee987c936e12527eea983df17270.zip |
Update frequently-asked-questions.rst
Diffstat (limited to 'docs/frequently-asked-questions.rst')
-rw-r--r-- | docs/frequently-asked-questions.rst | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/docs/frequently-asked-questions.rst b/docs/frequently-asked-questions.rst index f87b785d..33ed86d5 100644 --- a/docs/frequently-asked-questions.rst +++ b/docs/frequently-asked-questions.rst @@ -188,10 +188,19 @@ How do you represent double/float in Solidity? This is not yet possible. -Is it possible to in-line initialize an array like so: string32[] myarray = ["a", "b"]; +Is it possible to in-line initialize an array like so: string[] myarray = ["a", "b"]; ======================================================================================= -This is not yet possible. +Yes. However it should be noted that this currently only works with statically sized memory arrays. You can even create an inline memory +array in the return statement. Pretty cool, huh? + +Example:: + contract C { + function f() returns (uint) { + string[4] memory AdaArr = ["This", "is", "an", "array"]; + return ([1, 2, 3, 4][2]); + } + } What are events and why do we need them? ======================================== |