Functions would not be that interesting if they didn't accept parameters and return values. Functions are made generic with the use of parameters and return values. Parameters can help in changing function execution and providing different execution paths. Solidity allows you to accept multiple parameters within the same function; the only condition is that their identifiers should be uniquely named.
The following code snippets show the following multiple functions, each with different constructs for parameters and return values:
- The first function, singleIncomingParameter, accepts one parameter named _data of type int and returns a single return value that is identified using _output of type int. The function signature provides constructs to define both the incoming parameters and return values. The return keyword in the function signature...