Skip to content

Instantly share code, notes, and snippets.

@iveney
Created March 28, 2011 01:42
Show Gist options
  • Save iveney/889857 to your computer and use it in GitHub Desktop.
Save iveney/889857 to your computer and use it in GitHub Desktop.
enumeration usage example
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