Any fundamental difference between source and header files in C?

前端 未结 4 1095
故里飘歌
故里飘歌 2020-12-02 07:40

I don\'t quite understand how things should be separated in C\'s source and header files. I often see many projects with two sets of files with the same name (sans the exten

4条回答
  •  不知归路
    2020-12-02 08:32

    Usually, header files contain declarations, source files contain code.

    So, if in source file A.c you need a function implemented in source file B.c, you just include B.h to have its declaration.

提交回复
热议问题