How do header and source files in C work?

后端 未结 5 868
北海茫月
北海茫月 2020-11-30 18:07

I\'ve perused the possible duplicates, however none of the answers there are sinking in.

tl;dr: How are source and header files related in C? Do

5条回答
  •  醉梦人生
    2020-11-30 18:41

    The compiler itself has no specific "knowledge" of relationships between source files and header files. Those types of relationships are typically defined by project files (e.g., makefile, solution, etc.).

    The given example appears as if it would compile correctly. You would need to compile both source files and then the linker would need both object files to produce the executable.

提交回复
热议问题