It's programming time!/C++/include iostream

From Create Your Own Story

#include "stdafx.h"
#include <iostream>

int main()
{
std::cout << "Hello world!" << std::endl;
return 0; }

Okay, this has two parts:

#include
<iostream>

Well, the #include you should already know from #include "stdafx.h", and if you don't, well, go read that!

Anyways, in this case, this line includes:

<iostream>

Now, the < and > just surround the file you need to "include", in this case, iostream. Different files do different things. Some are created by you, others are part of your program creation program (I use visual studio, so everything will be towards that). In this case, the iostream file says how to handle the inputs, from like keyboard and mouse, and outputs, like to your printer or screen. That is why it is io-stream: io for input output, stream for the constant signals that the io stuff sends or receives.

Hey, don't ask me to explain everything...this is for programming, not teaching you how io works, or how computers work, or whatever. Just imagine they are always talking, so the iostream tells stuff you use to put things in and stuff you use to see what was put in how to talk to each other.

Personal tools