char to int

#include <iostream>
using namespace std;
int main()
{
	int a=1;
	char b = (char)(a+48);
	int c = (int)(b-48);
	if(b == '1')
	cout<<b<<endl;
	if(c == 1)
	cout<<c<<endl;
	getchar();
}


 

posted @ 2012-11-02 19:46  byfei  阅读(160)  评论(0编辑  收藏  举报