C: Why do we include header files, which declare but don't define?

后端 未结 5 689
迷失自我
迷失自我 2021-01-14 07:59

At a high level, I understand we use #include statements to make code from other files available to the current file. But I don\'t understand why we include a h

5条回答
  •  半阙折子戏
    2021-01-14 08:24

    Some people developing libraries do not want to let everyone know full code. They make it a library and then create the headers so everyone could use it. Moreover, @iharob's right, if we include definitions in headers, it's gonna make lots of troubles with code.

提交回复
热议问题