In C++ <iostream> is a class or header file or something else? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

In C++ <iostream> is a class or header file or something else?

Header file or class or method?

19th May 2018, 11:13 AM
Sourav Dutta
Sourav Dutta - avatar
7 Answers
19th May 2018, 11:21 AM
GAWEN STEASY
GAWEN STEASY - avatar
+ 5
C++ header files do not use the '.h' extension. That is a C convention that C++ dropped.
19th May 2018, 11:56 AM
John Wells
John Wells - avatar
+ 3
Razvan plus the classes they are defined as.
28th Aug 2018, 1:05 PM
John Wells
John Wells - avatar
+ 2
Ok Sourav Dutta, iostream is a library that provide input and output service.
19th May 2018, 11:22 AM
Ulisses Cruz
Ulisses Cruz - avatar
0
A header file ends with an extension of '.h' but iostream have no extension and if we provide any .h extension then it will produce an error of missing files or directories. It is a prototype declaration of i/o means cout and cin, that gives an abstraction to the compiler about the i/o. It will produce an error of non declaration if we don't write <iostream> or if we write <ostream> or <istream> or <iostream.h>. You can check by removing the syntax of <iostream> Check it out here. https://code.sololearn.com/cYiI4f79eId6/?ref=app
19th May 2018, 11:19 AM
Sourav Dutta
Sourav Dutta - avatar
0
header file
19th May 2018, 3:49 PM
Harsh Vardhan Joshi
Harsh Vardhan Joshi - avatar
0
so what #include <iostream> does it adds cin and cout to our service?
27th Aug 2018, 6:34 PM
Razvan
Razvan - avatar