I had a question. I have a mapping that maps to struct.
contract A{
struct struct1{
//...members...
}
struct struct2{
struct1 input1;
}
mapping (uint => struct1) mapToStruct;
struct2[] allEntries;
//...rest of the code for populating mapToStruct
}
contract B is A{
function addToStruct2(uint _mappingNumber) returns(bool status){
struct2 memory newMember;
struct1 memory newEntry;
newEntry = mapToStruct[_mappingNumber];
newMember.input1 = newEntry;
allEntries.push(newMember);
return true;
}
}
But this code is not working, I am not able to add the details to allEntries. The array has a new entry but all its members are 0, even after addToStruct2 returns true. Thanks in advance
struct2 tempStruct = struct2(x,y,z,...);and thenallEntries.push(tempStruct);, but still no progress. I understand it is getting very complex, but there must be something which I missing. btw Thanks again :) – 11t Mar 28 '17 at 21:51