Does #include affect program size?

后端 未结 8 1029
一整个雨季
一整个雨季 2021-01-13 09:07

When my cpp file uses #include to add some header, does my final program\'s size gets bigger? Header aren\'t considered as compilation units, but the content of

8条回答
  •  青春惊慌失措
    2021-01-13 09:37

    It's good practice to limit the #includes in a file to those that are necessary. Besides affecting the executable size, having extra #includes will cause a larger list of compile-time dependencies which will increase your build-time if you change a commonly #included header file.

提交回复
热议问题