I was writing some code in a project spanning multiple *.c and *.h files (i guess I can call the *.c and *.h as modules or programs) and forgot to declare a newly created "getter" function in the header file for particular module/program. The header file was included in another module which needed access to that getter function. Somehow the program worked fine!
- I would like to know what is the importance of the declaring function prototypes in the header if the linker is able link object files to sort things out for itself. Duplicate function resolution??? This would mean that linker links by function name by matching it to what is called in function.
- How does linker treat the extern variables?