怎样把ASCII码值转为INT型数值
例如 ASCII码 65 ,对应的字符为 A,我想转换成 10 ,怎么转?基础薄弱,求指导
[解决办法]
void __fastcall TForm1::Button1Click(TObject *Sender)
{
int i=65;
char c= char(i);
char Text[10]={0};
Text[0] = c;
String s;
s = "0x"+String(Text);
Caption = s.ToInt();
}
char c = 65;
int r;
if (c >= '0' && c <= '9') r = (c - '0');
else if (c >= 'A' && c <= 'F') r = (c - 'A' + 10);
else if (c >= 'a' && c <= 'f') r = (c - 'a' + 10);