I am trying to compile the following program. I have declared a structure and I am passing a variable of it in a function in order to assign it to an array of structure.
pragma solidity ^0.5.1;
contract investorPayment{
struct st_investors{
uint invested;
uint payout;
address payable Address;
}
st_investors[100] investors;
function pay(uint min_investment, address payable addr, st_investors memory newInvestor) public{
uint payout;
for (uint i=0; i < investors.length; i++) {
investors[i].Address = addr;
if (investors[i].invested == min_investment) {
payout = investors[i].payout;
if (!(investors[i].Address.send(payout)))
revert();
investors[i] = newInvestor;
}
}
}
}
I am getting the following error message:'
solc failedsend.sol failedsend.sol:11:60: Error: This type is only supported in the new experimental ABI encoder. Use "pragma experimental ABIEncoderV2;" to enable the feature. function pay(uint min_investment, address payable addr, st_investors memory newInvestor) public
^-----------------------------^
Somebody please guide me.
Zulfi.