为什么有些人在C++程序的开头放了一个空白的#include?

HSc*_*ale 5 c++

我已经看到一些程序在开头有一个空白的#include.我想知道这背后的目的是什么?

像这样:

 #include
 #include <iostream>
 // include more stuff
Run Code Online (Sandbox Code Playgroud)

示例链接:http://mkaczanowski.com/beaglebone-black-cpp-gpio-library-for-beginners/#important_methods

Ice*_*ind 9

为您发布的链接吐出格式化HTML代码的预处理器是错误的.看看GitHub上的源代码,你会看到,它应该是这样的:

#include <iostream>
#include "GPIO/GPIOManager.h"
#include "GPIO/GPIOConst.h"
...
Run Code Online (Sandbox Code Playgroud)

作为FYI,您提交的代码无法编译.在C++中简单地说一条线就是非法的#include.编译器将期望一个文件,因此它知道要包含什么.