原创 C++枚舉類型,模板類

1、定義枚舉類型 //定義枚舉類型,其中對應的分別是 0 1 2 3 4。。。 enum spectrum {red, orange, yellow, green, blue}; spectrum band; 枚舉類型的賦值只能是定義