This section contains 886 words (approx. 3 pages at 300 words per page) |
In programming, a function is generally defined as a named segment of code that performs a specific task. In this sense a function is the same as a routine or procedure, and the terms are often used interchangeably. In many programming languages, however, a function is defined as a very specific type of routine--one that generates a value that is returned to and used by the statement that calls the routine. In these languages the terms "function" and "procedure" are not interchangeable. Instead, "function" is used to refer to a routine that returns a value, and "procedure" is used to refer to a routine that does not return a value.
All routines (whether functions or procedures) have a name. This name is assigned when the routine is first defined and is "called" to execute the routine. For example, a routine that contains code used to determine the width...
This section contains 886 words (approx. 3 pages at 300 words per page) |