Created
August 14, 2015 07:32
-
-
Save derofim/d6a6b2f5851634bde0e7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #include <iostream> | |
| enum class Color { RED, GREEN, BLUE }; | |
| Color redColor = Color::RED; // RED -> Color::RED | |
| int num = ( int ) Color::GREEN; // RED -> ( int ) Color::RED | |
| int main() | |
| { | |
| if ( redColor == Color::GREEN ) { std::cout << "RED == GREEN"; } // false | |
| if ( num == (int) Color::GREEN ) { std::cout << "x=1 == GREEN"; } // true | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment