C+++++++++++++++++

来源:百度知道 编辑:UC知道 时间:2024/05/13 13:13:15
iostream 和 iostream.h 有什么区别?

C++标准是规定的iostream的,如楼上所述。比较老的编译器才是iostream.h。

用前者要这样:
#include <iostream>
using namespace std;

用后者只需要这样:
#include <iostream.h>

iostream.h的标准库函数不在std这个名称空间,iostream的函数都封装在std名称空间内,一般来说不带.h的写法符合ANSI/ISO C++标准