What does the compiler assume if no prototype of a function is mentioned and it directly encounter a user-defined function's call? like return types, no. and type of parameters?
-
I would like to know what parameters can i have as actual parameters or formal parameters and also the return type if no prototype of that function is declared. Also i would like to know the answwers referring to different compilers like gcc, visual studio, TC, etc.
-
Answer:
When a function is not declared in a compilation unit, the c language specifies that the following implicit declaration is made: int f(); which is a function accepting any number of parameters and returning an int. The C99 standard removed this feature, which was still supported in C89. But typically compiler implementors hate to make changes which would prevent old programs from compiling, so in most cases implicit function declarations are accepted with a warning. There is usually an option to cause an error on missing prototypes (for example -Wmissing-prototypes when using gcc). In C++ prototypes are always required.
Gregory Popovitch at Quora Visit the source
Related Q & A:
- What Is The Geometric Meaning Of Third Derivative Of A Function At A Point?Best solution by Mathematics
- What's it like to be a doctor?Best solution by Yahoo! Answers
- What's it like being in a sorority?Best solution by Yahoo! Answers
- What's it like being a physical therapy assistant?Best solution by Yahoo! Answers
- What's it like having the job of a physician's assistant?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.