Ask your own question, for FREE!
Computer Science 18 Online
OpenStudy (blackstreet23):

#include using namespace std; What does this stands for in C++?

OpenStudy (turingtest):

`#include` is used to include a library of functions and classes into the code. It literally just copies and pastes the function definitions into the executable when the code is compiled (turned into zeroes and ones). In this case, you are including the library iostream, which has a bunch of functions that tell your computer how to input and output data (that is the 'io' part of 'iostream'). Namespace is a little trickier to explain, but I will just describe it as giving a context to the functions you are using, allowing you to differentiate between two functions with the same name. If you do not do `using namespace std;`, then when you use `cout` and `cin` you will have to instead write `std::cout` and `std::cin`. The symbol `::` is called the "scope resolution operator," because it "resolves the scope" of (specifies) certain identifiers. This is something you will learn more about later on, don't worry too much about it yet.

OpenStudy (turingtest):

If you do not `#include <iostream>` you will not be able to use `cout` or `cin` at all.

OpenStudy (blackstreet23):

Thanks a lot!!! You give me pretty good answers!

OpenStudy (turingtest):

I'm glad you think so :) If I don't, feel free to ask for clarification.

OpenStudy (turingtest):

To elaborate, `cin` and `cout` are not built into C++; they are objects that need to be defined. They are defined in the library iostream, hence you must include iostream to use them.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!