Created
March 28, 2011 01:42
-
-
Save iveney/889857 to your computer and use it in GitHub Desktop.
enumeration usage example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum label{A,B,C,D,E,N}; // N is exactly the size | |
char * desc="ABCDE" | |
vector<int> v(N); | |
// do sth. | |
cout << desc[A] << "'s value is " << v[A] << endl; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment