I have two structs - property and owner.
struct owner {
string ownerName;
string ownerID;
}
struct property {
string location;
uint sqFeet;
owner[] owners;
}
I want to keep track of the owners of a property. So the current owner of a property will be the owner who was added last.
mapping(uint => property) selectedProperty;
function createProperty(string memory l,uint sf,string memory on,string memory OID,string memory PID) { //PID is calculated based on property information
selectedProperty[PID].location = l;
selectedProperty[PID].sqFeet = sf;
selectedProperty[PID].owners.push(owner(on,OID));
}
function display(uint PID) public view returns(property memory) {
return selectedProperty[PID]
}
When I display the property details in remix, I get the following as output 0: tuple(string,uint,tuple(string,string)[]): London,4000,0,Mike,NTX670
Why 0 is displayed?
pragma
for the precise compiler version.