A
Alex
It's actually "non-prototype declaration" (or "old style declaration")
and "prototype declaration". Plain "declaration" means either of the two.
Indeed. That sounds more correct.
Alex
It's actually "non-prototype declaration" (or "old style declaration")
and "prototype declaration". Plain "declaration" means either of the two.
I initially thought that one would only really need to use a function
prototype if the type the function returned was not an int - I was
under the impression that if there was no prototype, the compiler
would assume it was an int. However, my compiler (gcc) squawks at me
if I do not use a prototype even if the function returns an int.
the prototype does more than allow the compiler to check for
a return type perhaps? It also allows for it to check that the
arguments at the function call are of the same type as the parameters
of the function?
Is it proper (as regarding making portable
programs) to *always* use a function prototype? And then my second
question is, If the actual function serves as a prototype also, why
not just put all the functions before main()?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.