C++ 关于输入输出流的头文件引用
这样的一段程序:
#include<iostream.h>
int main()
{
cout << "Come up and C++ me some time.";
cout << "YOU won-t regret it!" << endl;
int i=0;
cin>>i;
return 0;
}
引用的是#include<iostream.h>的话,就不需要在cout前面加 std::这个名称空间了,但是如果引用的是#include<iostream>的话就需要在cout前面加 std::或者在引用下面写上
using namespace std; //不加这个的话, 就要 std::cout这么写
原因不甚清楚。