In a prototype, parameter names are optional (and in C/C++ have function prototype scope, meaning their scope ends at the end of the prototype), however, the type is necessary along with all modifiers (e.g. into parts that a compiler can separately translate into object files, to be combined by a linker into an executable or a library. The term "function prototype" is particularly used in the context of the programming languages C and C++ where placing forward declarations of functions in header files allows for splitting a program into translation units, i.e.
what data types go in and come out of it. While a function definition specifies how the function does what it does (the "implementation"), a function prototype merely specifies its interface, i.e. In computer programming, a function prototype or function interface is a declaration of a function that specifies the function’s name and type signature ( arity, data types of parameters, and return type), but omits the function body. JSTOR ( September 2016) ( Learn how and when to remove this template message).Unsourced material may be challenged and removed.įind sources: "Function prototype" – news Please help improve this article by adding citations to reliable sources. This article needs additional citations for verification.