Is it a good idea to put all of your includes in one header file?

后端 未结 7 814
青春惊慌失措
青春惊慌失措 2021-01-04 21:08

What is the best practice for C what you put into a C header file?

Is it useful to put all the includes used for a program across multiple source files in one header

7条回答
  •  旧时难觅i
    2021-01-04 21:17

    A header file is actually what you include from your c program. It containts data structures like structs, macros, function definitions etc.. Sometimes a single header file can be ok, buy if your program grows into logical components, you may need more.

提交回复
热议问题