So I recently started C++ but in the beginning you must always include something my theory is that it is a library of things you can read from like the following codes are just a book and each book you can use to your will or maybe not I've wondered this for a while but all I saw was tutorials that said "You just have to have it, it it might not make sense but use it anyway" type of thing maybe I'm a pointless noob maybe your a more experienced programmer but <insert witty snap back here>
p.s. Thanks to all the experienced programmers out there who answer these
The header files contain the implementations or the logic of the functions. For example, if you wanted to use cout, you would need to #include <iostream>, a header file that contains the rules on how cout works. The header files you include are determined by what you need to do in your program. You will also need using namespace std; in your programs. To put it simply, this statement allows you to write shorter code... among other things.
#include <iostream> Lines beginning with a hash sign (#) are directives for the preprocessor. They are not regular code lines with expressions but indications for the compiler's preprocessor. In this case the directive #include <iostream> tells the preprocessor to include the iostream standard file. This specific file (iostream) includes the declarations of the basic standard input-output library in C++, and it is included because its functionality is going to be used later in the program.