What do .c and .h file extensions mean to C?

前端 未结 6 1590
有刺的猬
有刺的猬 2020-12-04 08:29

It\'s all in the title; super-simple I reckon, but it\'s so hard to search for syntactical things anywhere.

These are two library files that I\'m copying from CS50.n

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-04 08:43

    They're not really library files. They're just source files. Like Stefano said, the .c file is the C source file which actually uses/defines the actual source of what it merely outlined in the .h file, the header file. The header file usually outlines all of the function prototypes and structures that will be used in the actual source file. Think of it like a reference/appendix. This is evident upon looking at the header file, as you will see :) So then when you want to use something that was written in these source files, you #include the header file, which contains the information that the compiler will need to know.

提交回复
热议问题