Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do some people put a blank #include at the begining of C++ Programs? [closed]

Tags:

c++

I've seen a couple of programs that have a blank #include at the beginning. I would like to know what's the purpose behind this?

Like this:

 #include
 #include <iostream>
 // include more stuff

Example Link: http://mkaczanowski.com/beaglebone-black-cpp-gpio-library-for-beginners/#important_methods

like image 919
HSchmale Avatar asked Jan 14 '15 22:01

HSchmale


1 Answers

The preprocessor that spits out the formatted HTML code for the link you posted is buggy. Look at the source code on GitHub and you'll see, it should look like this:

#include <iostream>
#include "GPIO/GPIOManager.h"
#include "GPIO/GPIOConst.h"
...

As an FYI, the code you submitted can't compile. It is illegal in C++ to simply have a line that says #include. The compiler will expect a file to follow so it knows what to include.

like image 78
Icemanind Avatar answered Sep 18 '22 09:09

Icemanind