char as int

#include<stdio.h>
#include<iostream>
using namespace std;
int main()
{
char a;
a=1;
char b;
b=2;
char c;
char d;

a=45;
b=135;
c=b-a;                 //work as int
cout<<c<<endl;
cout<<(int)c<<endl;

d=b/a;               ////// do not work
cout<<d<<endl;
cout<<(int)d<<endl;
a=330;
cout<<a<<endl;
}

 

---------------

Z
90

-2
J
请按任意键继续. . .

 

posted @ 2016-08-11 09:32  steven_xiu  阅读(135)  评论(0编辑  收藏  举报