+ 4
So far am I correct?
Maybe a stupid ? but I want to make sure I understand before I go any further. #include <iostream> gets basic C++ libraries that you can use like cout; endl and not sure what others. using namespace std; is used for name recognition; example will be like if you have two Heather's in your class and you need to define each one.
7 Respuestas
+ 4
The first one is nearly correct, it is basic C++ libraries for input and output
using name space std; allow you not to use std each time you use something in the namespace
For example :
std::cout become cout
+ 2
Like @Baptise said,
You are right about iostream.
Namespace is not used like that, it is used to include libraries like the std ( Standard library ).
Here is a refference for more information.
http://www.cplusplus.com/doc/tutorial/program_structure/
+ 1
Even I had the same doubt still not clear
+ 1
A post and code from today showed that,
@Thomas' second statement has truth to it.
Here is the thread
https://www.sololearn.com/discuss/475134/?ref=app
0
I guess so
BTW I can't assure you I am weak in c++
0
as the name suggests iostream (input output stream) allows you to take an input, process it and return an output in c++ so, yes you are right about the first one but you don't have to be sure about the second.. just take it as a shortcut to writing your code.. instead of writing std:: every time you use an iostream function I a pain... so writing that line allows you to use those functions without having to write std:: every time.. you will learn more about this when you startle learning about classes and headers. till then... knowing this Is enough!
hope this helps
peace✌
0
here I found a resource for you
https://www.quora.com/What-does-using-namespace-std-mean-in-C++