Solidity Input and Output Parameters Main Tips
- An arbitrary number of the parameters may also be returned as output.
Solidity Input and Output Parameters Input
The parameters used for input get declared similarly to normal variables.In the form of an exception, parameters that are not used may omit the variable name. For example, let’s say we want this contract to accept one sort of external calls using two integers. For that, we would write something like this:
Solidity Input and Output Parameters Output
The parameters that are used for output may be declared using the same syntax after the keyword returns. For example, let’s say we would like to return two results: the product of the given integers and the sum. This is the code we could use to accomplish this task:
The output parameter names may be omitted. The values used for output can also be specified with return statements. The return statements can also return more than one value. Return parameters get initialized to zero; in case they are not set explicitly, they stay at zero.
Input and output parameters may be used in the form of expressions in the body of the function. There, they can also be used on the assignment’s left-hand side.