Advertisement
baldengineer

enum increments

Jan 19th, 2020
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.24 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3.  
  4. int main() {
  5.         enum colors {red, green, blue} color;
  6.         printf("%d\n", color);
  7.         color++;
  8.         color++;
  9.         color++;
  10.         color++;
  11.         printf("%d\n", color);
  12. }
  13.  
  14. // #./test
  15. // 1
  16. // 5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement