+ 4

What is function prototype?

like char *strstr(const char *s1,const char *s2)

23rd Apr 2017, 4:46 AM
Mehedi hasan hamim
Mehedi hasan hamim - avatar
2 Respostas
- 1
simple function prototype mins function declaration
23rd Apr 2017, 5:10 AM
Mayur Chaudhari
Mayur Chaudhari - avatar
+ 9
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. While a function definition specifies how the function does what it does (the "implementation"), a function prototype merely specifies its interface, i.e. what data types go in and come out of it. 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. into parts that a compiler can separately translate into object files, to be combined by a linker into an executable or a library. 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. if it is a pointer or a const parameter). @wikipedia
23rd Apr 2017, 4:52 AM
Nithiwat
Nithiwat - avatar