Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. /*
  2. Enums are used to make sure a variable can only have one
  3. of a small possible subset of values.
  4. */
  5. #include <iostream>
  6. using namespace std;
  7.  
  8. enum direction
  9. {
  10. North,
  11. South,
  12. East,
  13. West
  14. } dir;
  15.  
  16. int main()
  17. {
  18. dir = West;
  19. cout << dir;
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement