Skip to content
C++
namepace Graph_lib{
struct Color{
		...
	}
struct Shape{
		...
	}
}

在这个命名空间中所有的结构体都不会冲突,Shape的实质是Graph_lib::Shape,这种写法称之为全限定名 为了简化写法,可以写为

C++
using std::cout;
using std::cin;

指定cout、cin使用std命名空间 更加简化,使std中的函数直接可用

C++
using namespace std;