how to convert a single element of string to ascii value(i.e. integer)?
i tried: 1. (int)s[0]; 2. s[0]-'0';
(int)s[0];
s[0]-'0';
With string s="iamtheone"; the output should be the ascii value of 'i'.
string s="iamtheone";
'i'
Aucun commentaire:
Enregistrer un commentaire