Created
May 28, 2015 07:49
-
-
Save MasazI/711dc9c7d74a9290acba to your computer and use it in GitHub Desktop.
short_cast.cpp
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
| // | |
| // static_cast.cpp | |
| // CplusplusPractice | |
| // | |
| // Created by masai on 2015/05/28. | |
| // Copyright (c) 2015年 masai. All rights reserved. | |
| // | |
| #include <iostream> | |
| using namespace std; | |
| int main(int argc, char* argv[]){ | |
| cout << static_cast<unsigned short>(-1) << endl; | |
| cout << static_cast<unsigned short>(0) << endl; | |
| cout << static_cast<unsigned short>(1) << endl; | |
| cout << static_cast<unsigned short>(65535) << endl; | |
| cout << static_cast<unsigned short>(65536) << endl; | |
| cout << static_cast<unsigned short>(65537) << endl; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment