-> I'm quite new to C++!
-> How can I change letters (Abc), which I enter into a string, into fixed numbers, like A->1, B->2....Z->26, so that I get two arrays, e.g. char alpha[26] and int num[26]. Thank you very much!
-> I'm quite new to C++!
-> How can I change letters (Abc), which I enter into a string, into fixed numbers, like A->1, B->2....Z->26, so that I get two arrays, e.g. char alpha[26] and int num[26]. Thank you very much!
/* Say letter is filled with 'A', 'B', ... */
char letter[26];
int numb[26];
for(int i=0;i<26;i++)
numb[i]=letter[i]-'A'+1;
/* I hope this is a proper answer */
thank you very much!!