summaryrefslogtreecommitdiff
path: root/c,cc/cast_char.cc
blob: c3a3315121cb8dc86ab3fe2bde4250764c8829ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>

using namespace std;

int main(void)
{
  int i = 255;
  char c = 'x';
  char d = -1;
  char e = 255;
  char f = 'f';
  char q = 127;
  
  std::cout << (char)i << std::endl;
  std::cout << (int)c << std::endl;
  std::cout << (int)d << std::endl;
  std::cout << (int)e << std::endl;
  std::cout << (int)f << std::endl;
  std::cout << (int)q << std::endl;
}