#include anywhere

后端 未结 7 1045
心在旅途
心在旅途 2020-12-15 08:55

Is the #include meant to be used for headers only or is it simply a mechanical \"inject this code here\" that can be used anywhere in the code?

7条回答
  •  南方客
    南方客 (楼主)
    2020-12-15 09:43

    #include and other preprocessor directives like #define or #import, can appear anywhere in the source, but will only apply to the code after that inclusion. It is meant to include the referenced code into the source file that calls it. This MSDN page explains it quite well. http://msdn.microsoft.com/en-us/library/36k2cdd4(v=VS.71).aspx

提交回复
热议问题