hi guys im new to solidity. Can someone tell me what the point of the 'returns' keyword (with specified type following) is - in a function declaration? Surprisingly difficult to find a good explanation online. Is this based on another language? example:
contract Simple {
function arithmetic(uint _a, uint _b)
public
pure
returns (uint o_sum, uint o_product)
Mar 1, 2022, 4:51 AM
Im seeing an example in a youtube video:
function hello() public pure returns (string memory) {
return 'hello world';
function hello() public pure returns (string memory) {
return 'hello world';
i dont understand what it is doing. Initializing variables to be returned? So does the name have to be same name of returned variables when there are more than one?
Mar 1, 2022, 4:54 AM