Skip to content

Instantly share code, notes, and snippets.

/Untitled1
Created May 2, 2016

Embed
What would you like to do?
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
You can’t perform that action at this time.