Why should I use function prototypes?

C# really pissed me off so I decided to return to learn C++. However, I really don't get why I should use function prototypes. Is there any real reason, or is only to make sure that you don't make mistakes in the real function?

Thanks.
So that the compiler can check whether you are passing the right arguments and resolve overloading.
You do not have to use prototypes; so long as you define the function before you use it, it will work.

In addition to Bazzy's words, if you ever want to use a function that you did not write and are not going to be compiling yourself (which I expect is very, very often), the compiler must still know what will be passed in and what will be returned.
Last edited on
Function a calls function b
Function b calls function a


You would need to use a prototype in that situation, no way that I know of around it.
Topic archived. No new replies allowed.