Does #include affect program size?

后端 未结 8 1012
一整个雨季
一整个雨季 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:24

    Yes, because for example inline functions can be defined in header files, and the code of those inline functions will ofcourse be added to your program's code when you call those functions. Also template instantiations will be added to the code of your program.

提交回复
热议问题