I recently approached the Smart contract two days ago. I'm still learning about it, and I have a lot of difficulties. Can you help me to create a variable like this photo?
It has a arrays of numbers from 1 to infinity. Each natural number has a array of characters. Each character has array of string, like ["abc","qwe"]
For example I have 2 functions:
- One for add data, like addString(uint number, uint character, string info)
- One for get data, like getString(uint number, uint character)
When I call addString(1,"a","abc"). It will create "a" if it does not already exist, after that it will put "abc" to array.
When I call addString(1,"a","qwe"). it will put "qwe" to array. Now the array of "a" like ["abc","qwe"]
When I call addString(1,"b","abc"). It will create "b" if it does not already exist, after that it will put "abc" to array. Now the array of "b" like ["abc"]
When I call getString(1, "a"), It will return ["abc","qwe"]
When I call getString(1, "b"), It will return ["abc"]
When I call getString(1, "c"), It will return []
This guy has problems almost like me. You can view this
Thanks for helping me

mapping(uint256 => string[])[]. The number is an index into the array.) – user19510 Aug 25 '18 at 15:26getString(). Solidity currently doesn't support returning arrays of arrays. (Astringis an array, so returningstring[]won't work.) If you can limit all your strings to a maximum of 32 characters, a common trick is to usebytes32instead ofstring. – user19510 Aug 25 '18 at 15:27stateID. Start by changing fromstringtostring[]. – user19510 Aug 25 '18 at 15:39struct Shipment { mapping(uint256 => string[]) hashes; /*maps stateIDs to hashes*/ }– user19510 Aug 25 '18 at 15:41