How to Initialize Input Parameters in the Procedures
- 1). Load the source code file for the program source code you want to edit. Click on the source code file to automatically open the default text editor for your system.
- 2). Locate a subroutine, function, or procedure. Functions can be identified by their signatures. A function has a return statement, a name, and a set of inputs. In the languages based on C (C, C#, C++, Java, ObjectiveC), a function signature may look something like this:
int functionName(int input)
{} - 3). Initialize the input parameters by using the assignment operator. You need to place the assignment operator inside the argument list of the function signature, and assign a default value to the input argument. For example, to set "input" from "functionName" to 0 by default, you could write the following:
int functionName(int input=0)
{}
Source...