Skip to content

Instantly share code, notes, and snippets.

Created May 2, 2016 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/60ef5725602d114fe39a867ed8ecc80b to your computer and use it in GitHub Desktop.
Save anonymous/60ef5725602d114fe39a867ed8ecc80b to your computer and use it in GitHub Desktop.
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://chriseth.github.io/browser-solidity/#version=soljson-latest.js&optimize=undefined&gist=
contract testStruct {
struct stru{
string[] s;
}
stru myStru;
/*
function add(string s) {
string[] strAr; // Uninitialized storage pointer. Did you mean ' memory strAr'?
strAr.push(s);
myStru = stru(strAr);
}
*/
function add(string s) {
string[] memory strAr; // just doesnt do anything, exception?
strAr[0] = s;
myStru = stru(strAr);
}
function getFirst(uint i) constant returns (string s) {
s = myStru.s[0];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment