为什么没有包含iostream头文件?

use*_*327 3 c++ io

#include <sstream>
using namespace std;

int main()
{
    cout << "hi"; // error: undeclared cout
}
Run Code Online (Sandbox Code Playgroud)

根据我的阅读,sstream类派生自iostream类,但为什么不自动包含它?

Pup*_*ppy 11

所述iostream基类是不一样的iostream报头.标准标题不必相互包含,也可以按任何顺序包含.如果你想使用的内容<iostream>,你必须#include <iostream>.