C++枚舉類型的意義:

1)C++ 中會使用const或者#define定義整型常量,當整型常量有多個且之間的值的所有或部分有遞加的時候,定義起來稍顯繁瑣,此時用枚舉顯得很簡潔:安全 例如:app //使用const:code const int MON =1; const int TUE=2; const int WED=3; const int THU=4; const int FRI=5; const int SA
相關文章
相關標籤/搜索