I got quite an interesting question. I have created an array of structs, and in each struct, I have an array of address. Then I got a method that when its called on given struct [index] its adds sender address to an array of an address of given struct.
Now my question is, is it possible to also add a string to each element of address array? From what I understand you can’t have 2d array of 2 different types?
struct Project{
int id;
string name;
int votes;
address[] voters;
}
Project[] public projects;
function vote(uint index , string comment) public {
Project storage project = projects[index];
Project.votes++
project.voters.push(msg.sender);
// now to add a string (comment) to each address that is added to address array
}