Skip to content

Instantly share code, notes, and snippets.

@MasazI
Created May 28, 2015 07:49
Show Gist options
  • Select an option

  • Save MasazI/711dc9c7d74a9290acba to your computer and use it in GitHub Desktop.

Select an option

Save MasazI/711dc9c7d74a9290acba to your computer and use it in GitHub Desktop.
short_cast.cpp
//
// 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