C++中将char转换为int型

日期:2017-11-24 19:07:17 人气:1

C++中将char转换为int型

char c; int a; 如果a=int(c);a的值为字符的ASCII码,如果a=c-‘0’;a的值就是字符所代表的阿拉伯数字
    A+
热门评论