current position:Home>Error in solidity: typeerror: data location must be 'memory' for return

Error in solidity: typeerror: data location must be 'memory' for return

2022-02-03 23:19:07 Q & A of Denglian community

pragma solidity >=0.4.0 <0.7.0;contract HelloWorld{    string public stateVariable = "Hello World";    int int1;   function GetHelloWorld() public view returns (string  _hello){        _hello=stateVariable;    }}

solidity Compilation appears :TypeError: Data location must be "memory" for return parameter in function, but none was given.






Other answers 1:


Other answers 2:

copyright notice
author[Q & A of Denglian community],Please bring the original link to reprint, thank you.
https://en.netfreeman.com/2022/02/202202032319063996.html

Random recommended