In my program I have a string of caracters that are all digits and I want to use them as indexes to get values from a vector. But the output of this code is a 15 digit number, so not 1 which is vect[0] i.e. what I thought it would output.
char c = '0';
vector<int> vect = {1};
int i = (int)c;
cout<<vect[i];
I have seen that converting from a caracter to an integer is done with
int i=(int)c;
So i really don't get how that is not an appropriate type for an index.