I have some doubt as to why we use ".h" after iostream
and do not include using namespace std;
because with any other compiler we don't use ".h" after iostream and we add always use using namespace std;
.
Why?
Asked
Active
Viewed 753 times
-2

Sunil
- 39
- 9
-
10Because Turbo C++ is was outdated 20 years ago and nothing changed since then. – Yksisarvinen May 28 '20 at 10:36
-
2Also, "*add always use `using namespace std;`*" - don't. See [Why is “using namespace std;” considered bad practice?](https://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice) – Yksisarvinen May 28 '20 at 10:36
-
2Possible duplicate: https://stackoverflow.com/questions/214230/iostream-vs-iostream-h-vs-iostream-h https://stackoverflow.com/questions/14389561/what-is-the-difference-between-including-iostream-and-including-iostream-h https://stackoverflow.com/questions/2976477/difference-between-iostream-and-iostream-h – Jerry Jeremiah May 28 '20 at 10:47
-
3The DOS emulator and 16-bit UI is a clue – Asteroids With Wings May 28 '20 at 11:31
1 Answers
3
why do we use
<iostream.h>
in turbo c++ IDE
Because turbo c++ IDE uses the turbo c++ compiler, which was written before c++ was standardised. In that ancient dialect of the language, the STL header is named differently from the standard library header that we have in the standard.
That said, very few people use turbo c++ in the real world.
and add always use using namespace std;
No. We never use using namespace std;
. And you should neither.
But specifically in turbo C++ dialect, the language didn't have namespaces yet.

eerorika
- 232,697
- 12
- 197
- 326