在 C++ 中 using namespace std;
有什么用,什么时候用什么时候可以不用,
#include<iostream.h>
using namespace std;
class point
{
public:
int x;
int y;
void print()
{
cout<<"x="<<x<<endl;
cout<<"y="<<y<<endl;
}
};
void main()
{
point pt;
pt.x=0;
pt.y=1;
pt.print();
}
这段代码如果不注释掉 using namespace std;
运行就会提示出错,为什么?
“里面有……………………”有啥,后面的我的上面就不显示了