LEARN SOLIDITY LESSON
Return Values . Multiple Return Values in Solidity
Multiple Return Values in Solidity
This multipleReturns function is the first example we've seen that returns multiple values. Let's look at how to handle them:
function multipleReturns() internal returns(uint a, uint b, uint c) { return (1, 2, 3); } function processMultipleReturns() external { uint a; uint b; uint c; // get all A,B,C (a, b, c) = multipleReturns(); } function getLastReturnValue() external { uint c; (,,c) = multipleReturns(); //only C }
Comments