How is the function declaration different from the function prototype?
I’m posting this question in reference to this answer on a question.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A Function declaration may/may not not include the function arguments.
While a Function Prototype must include the function arguments.
From Wikipedia:
Consider the following function prototype:
This prototype specifies that in this program, there is a function named
facwhich takes a single integer argumentnand returns an integer. Elsewhere in the program a function definition must be provided if one wishes to use this function.It’s important to be aware that a declaration of a function does not need to include a prototype. The following is a prototype-less function declaration, which just declares the function name and its return type, but doesn’t tell what parameter types the definition expects.