I have been trying to understand when to use calldata and memory in function arguments . I know calldata is used with external and internal functions and memory is used with public functions.
But I don’t understand when to use any ,I have seen many examples still cant get over it .
I came to know about an error from remix online editor “Data location can only be specified for array,struct or mapping but memory/calldata was given”.
But in this example https://solidity.readthedocs.io/en/v0.6.3/solidity-by-example.html#the-full-contract ,memory is used with bytes