Programming: Creating a Function with a Return and Parameters to be Passed In
Share
A function that contains a return is prefixed with a type name. If the function has parameters to be passed in, the parameters will be contained in parenthesis and suffix the function name. For example, a function that returns an integer and has a char parameter would look like this: The Example in the video was created for the ButtonPress library.
int functionName(char variableThatIsChar) { some code ... return anIntegerValue; } The integer return value is created from the code within the function.