I am new to C++ from Python. When we write #include<iostream>
, we are including a library or module. So can we write iostream::std::cout<<
?
Asked
Active
Viewed 33 times
-3

ccdq23
- 7
- 2
-
2Neither a library, nor a module. The best way to learn C++ is to [read a good book](https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list) instead of attempting to draw analogies with other programming languages that have absolutely nothing in common, whatsoever, with C++. C++ is fundamentally different, in every possible way, from Python. You will do yourself a favor by pretending to forget everything you know about Python, before learning C++. – Sam Varshavchik Oct 05 '17 at 00:45
-
"So can we write iostream::std::cout<<"? Yes, but it won't compile. `std::cout << ThingIWantToPrint;` is sufficient. – user4581301 Oct 05 '17 at 00:46
1 Answers
0
When you write #include<iostream>
, you tell preprocessor to put content of iostream file directly instead of that line.

Grigory
- 119
- 1
- 10