Ask Question
4 March, 20:40

Why do you need to include function prototypes in a program that contains user-defined functions?

+5
Answers (1)
  1. 4 March, 21:47
    0
    One file becomes one object module and become part of the program or library. In case I had a function definition in another. cpp file and the function call in another. cpp file, how would the function be made known? Function Prototypes.

    Either the file calling the function from a different file implements a function prototype or it will include the prototypes via header file. What you know now is that the prototype propagates that a function definition is present though the compiler does not "see" the definition, when compiling the current module.

    If the function definition is not there at link time then you would face a linker error.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Why do you need to include function prototypes in a program that contains user-defined functions? ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers