+ 2
In C++ <iostream> is a class or header file or something else?
Header file or class or method?
7 odpowiedzi
+ 14
<iostream> header file is included to provided access to input and output global objects such as cin and cout.
https://www.sololearn.com/Discuss/89048/?ref=app
https://www.sololearn.com/Discuss/612851/?ref=app
https://www.sololearn.com/Discuss/76430/?ref=app
https://www.sololearn.com/Discuss/232791/?ref=app
+ 5
C++ header files do not use the '.h' extension. That is a C convention that C++ dropped.
+ 3
Razvan plus the classes they are defined as.
+ 2
Ok Sourav Dutta,
iostream is a library that provide input and output service.
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
0
header file
0
so what #include <iostream> does it adds cin and cout to our service?