How can store and retrieve data (many stings) while the array is an attribute of an object. I mean how to store the user info including stings in the sting[] and retrieve all User info including all the strings in the string array
struct User {
uint256 id;
//other attributes
string[];
}
Best Answer
I've created a example smart contract to demonstrate how to push data in a struct's array. This is done in the
addData
function. The array's elements can be altered as demonstrated insetData
.