<iostream> and <iostream.h> ?? /////cout and std::cout ????? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

<iostream> and <iostream.h> ?? /////cout and std::cout ?????

what's the difference between this headers in iostream and what's the difference between cout orders ?!!!!

27th Jan 2017, 9:55 AM
Amr Monsef
Amr Monsef - avatar
1 Answer
+ 3
"iostream.h is deprecated by those compilers that provide it, iostream is part of the C++ standard." std:: is a namespace, like a package when you do std::cout it will specificly get that method/function from std:: "package" people use this because there might be more than one package that are using same function/method names and if they didnt specify that the code wouldn't work as expected. If you dont do "big" stuff, you can go ahead and define the namespace so you dont have to write std:: all the time.. and in order to do that you can use using namespace std; after declaring that you won't have to use std:: anymore
27th Jan 2017, 2:14 PM
Nedim Kanat
Nedim Kanat - avatar