4 ms·
Wherever the code refers to a variable or function, the compiler only allows this if it has previously seen a declaration for that variable or function—the decl
by bluetomcat 12y ago
Wherever the code refers to a variable or function, the compiler only allows this if it has previously seen a declaration for that variable or function—the declaration is a promise that a definition exists somewhere else in the whole program.
The notable exception here is implicitly declared functions, but they were dropped in C99 anyway.
- rocky1138 12y agoIndeed. After reading the OP and finally getting a handle on how linkers, assemblers, compilers, etc. work, I asked myself why functions weren't just implicit. Turns out K&R thought the same, but the solution sucked because it assumes an int return, which may not be what the function actually returns.