Some languages provide the facility to declare functions and subroutines through the use of function prototyping.



Task

Demonstrate the methods available for declaring prototypes within the language. The provided solutions should include:

 An explanation of any placement restrictions for prototype declarations
 A prototype declaration for a function that does not require arguments
 A prototype declaration for a function that requires two arguments
 A prototype declaration for a function that utilizes varargs
 A prototype declaration for a function that utilizes optional arguments
 A prototype declaration for a function that utilizes named parameters
 Example of prototype declarations for subroutines or procedures (if these differ from functions)
 An explanation and example of any special forms of prototyping not covered by the above


Languages that do not provide function prototyping facilities should be omitted from this task.




integer f0(void);               # No arguments
void f1(integer, real);         # Two arguments
real f2(...);                   # Varargs
void f3(integer, ...);          # Varargs
 
void f4(integer &, text &);     # Two arguments (integer and string), pass by reference
integer f5(integer, integer (*)(integer));
                                # Two arguments: integer and function returning integer and taking one integer argument
integer f6(integer a, real b);  # Parameters names are allowed
record f7(void);                # Function returning an associative array