#include <iostream> using namespace std; int main() { cout<<"hello,world"<<endl; return 0; }
cout是在std这个名字空间内的。名字空间主要是用来防止名字冲突的。 你最好找一下有关C++名字空间的东东看一下
引用 1 楼 ri_aje 的回复: 因为 cout 和 endl 是 namespace std 的成员。 不想用 using namespace 的话,可以写 C/C++ code?1std::cout<<"hello,world"<<std::endl; 还有其他的命名空间吗?
引用 1 楼 ri_aje 的回复:因为 cout 和 endl 是 namespace std 的成员。 不想用 using namespace 的话,可以写 C/C++ code?1std::cout<<"hello,world"<<std::endl; 还有其他的命名空间吗?
因为 cout 和 endl 是 namespace std 的成员。 不想用 using namespace 的话,可以写 C/C++ code?1std::cout<<"hello,world"<<std::endl;
std::cout<<"hello,world"<<std::endl;
64,649
社区成员
250,477
社区内容
加载中
试试用AI创作助手写篇文章吧