由于C++ 1998要求 cout and endl 使用std::cout,std::endl格式,或者在程序开始申明“ using namespace std;”,不然会出现”cout was not declare this in scope“的错误
#include<iostream>
int main(void)
{
cout<<"helloworld"<<endl;
return 0;
}
修改成下面的代码就可以了
#include<iostream>
int main(void)
{
using namespace std;
cout<<"helloworld"<<endl;
return 0;
}