vendredi 13 septembre 2019

Conversion of string element to ascii(int) [on hold]

how to convert a single element of string to ascii value(i.e. integer)?

i tried:
1. (int)s[0];
2. s[0]-'0';

With string s="iamtheone"; the output should be the ascii value of 'i'.

Aucun commentaire:

Enregistrer un commentaire