Question:
Why should I prototype a function?
Answer:
A function prototype tells the compiler what kind of arguments a function is looking to receive and what kind of return value a function is going to give back. This approach helps the compiler ensure that calls to a function are made correctly and that no erroneous type conversions are taking place. Source: CoolInterview.com
Prototype of the function tell compiler that we will use this function in our program and it will run even if we do not write code of function Source: CoolInterview.com
Answered by: MUHAMMAD AAMIR SAYEED | Date:
| Contact MUHAMMAD AAMIR SAYEED
prototype of function tells compiler about function behaviour it means due to prototype compiler knows for things 1.name of function:-it is the identifier which is used to call a function 2.type of function:-it tells which type of value function will return 3.no of argument:-it tells how many arguments are reuired to call a funtion 4.types of argument:-it tells types of arguments which are passed to a function Source: CoolInterview.com
Answered by: syed khursheed ahmed | Date: 7/17/2009
| Contact syed khursheed ahmed
a function protype calls the compilerand which argument recive and retun the value to given program Source: CoolInterview.com
Answered by: aniket | Date: 8/31/2009
| Contact aniket
the user defined function which we are going to use,is not aware to compiler so first we have to tell the behaviour of function to compiler. when complier executes function protype code, then compiler knows that there is a function of this type used in the program. Source: CoolInterview.com
Answered by: Amol Patil | Date: 10/5/2009
| Contact Amol Patil
prototype of the function tell the compiler to recieve and return what type of data from the function at time of compilation and easy to identify the function. Source: CoolInterview.com
Answered by: LAXMAN HONAWAD | Date: 11/21/2009
| Contact LAXMAN HONAWAD
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|