码迷,mamicode.com
首页 > 其他好文 > 详细

需要用的头文件优先放在哪里

时间:2019-09-28 20:29:54      阅读:87      评论:0      收藏:0      [点我收藏+]

标签:eve   使用   它的   one   https   des   includes   file   oss   

Put as much as you can in the .c and as little as possible in the .h. The includes in the .c are only included when that one file is compiled, but the includes for the .h have to be included by every file that uses it.

尽量放在.c中,而尽量避免放到.h中.在.c中只是在编译时被included,而在.h中则是被每个使用它的文件都included了.

整理自:https://stackoverflow.com/questions/3002110/include-in-h-or-c-cpp

需要用的头文件优先放在哪里

标签:eve   使用   它的   one   https   des   includes   file   oss   

原文地址:https://www.cnblogs.com/Stephen-Qin/p/11604457.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!