Function prototype: Difference between revisions

From Rosetta Code
Content added Content deleted
m (wordliness)
m ({{omit from|AWK}})
Line 1: Line 1:
{{draft task}}
{{draft task}}
Some languages provide the facility to declare functions and subroutines through the use of *function prototyping*. The task is to demostrate the methods available for declaring prototypes within the language. The provided solutions should include:
Some languages provide the facility to declare functions and subroutines through the use of '''function prototyping'''. The task is to demostrate the methods available for declaring prototypes within the language. The provided solutions should include:


* An explanation of any placement restrictions for prototype declarations
* An explanation of any placement restrictions for prototype declarations
Line 10: Line 10:
* An explantion and example of any special forms of prototyping not covered by the above
* An explantion and example of any special forms of prototyping not covered by the above


{{omit from|AWK}}
{{omit from|GUISS}}
{{omit from|GUISS}}
{{omit from|Tcl|Goes against the language's principles.}}
{{omit from|Tcl|Goes against the language's principles.}}

Revision as of 20:36, 21 July 2011

Function prototype is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.

Some languages provide the facility to declare functions and subroutines through the use of function prototyping. The task is to demostrate the methods available for declaring prototypes within the language. The provided solutions should include:

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