Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Why "when a program calls a function that can't see the prototype, the compiler thinks that the function returns an integer value"?
Why "when a program calls a function that can't see the prototype, the compiler thinks that the function returns an integer value"?
This is an exercise of the compiler. At the beginning, the compiler was designed to treat functions without prototypes as plastic.

When a compiler sees a function, it will first look for the prototype of the function. If there is no prototype, it will look for the definition part of the function.

In addition, in C, in C++, if the defined function does not specify the return type, it will not be compiled.