|
|
之前说的在vc6中(未打任何补丁和使用stlport的情况下),用:
#include<iostream>
using namespace std;
//之后是cout等的使用
会出现很多错误是不正确的。这种方式是可被编译器接受的。
下面是我在VC6和Dev-C++4.9.9.0中测试的结果:
一.#include <iostream>
using namespace std;
int main()
{
cout << "hello,world" << endl;
return 0;
}
二.#include <iostream.h>
//using namespace std;
int main()
{
cout << "hello,world" << endl;
return 0;
}
三.#include <iostream.h>
using namespace std;
int main()
{
cout << "hello,world" << endl;
return 0;
}
这三种方式在Dev-C++4.9.9.0中都可以被接受。而在VC6中第三种方式是不被接受的。
这是我测试的结果,希望得到大家的指正! |
|