#include <sstream>
using namespace std;
int main()
{
cout << "hi"; // error: undeclared cout
}
From what I have read, sstream class is derived from iostream class but why does it not get included automatically?
The iostream-based classes are not the same as the iostream header. Standard headers do not have to include each other, or may include each other in any order. If you wish to use the contents of <iostream>, you must #include <iostream>.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With