I'm using:
pragma solidity ^0.5.0;
I have a function as below in my contract:
function test(string a) external{
a="apple";
}
An error shows up saying I need to add "calldata" to the parameter. So, if I do the following the error disappears:
function test(string calldata a) external{
a="apple";
}
Question: Why do I need to add "calldata" when I use string type as a parameter?