Does the memory operation require no gas at all? I knew it was a bit needed. But, memory operations works fine in the view function.
for example,
contract TestContract{
uint testUint;
function testFunc() public view returns(uint[]){
uint[] memory testArr = new uint[](1);
testArr[0]++; // This line works fine.
testUint++; // This line not works.
return testArr;
}
}
Why does the memory operation in the view function works?
I did not speak English well and I got help from translator. Thank you for your understanding.