say we have a char array of that you've gotten from the user, and that array of chars looks something like this char line[] = {'1', '2', '3', '4', '\0'};
which is basically equivalent of entering 1234
in the console.
it would then be possible to get the integer value of an indexed position in the previously mentioned array by doing something like this: int one = line[0] - '0';
this:
char line[] = {'1', '2', '3', '4', '\0'};
int one = line[0] - '0';
std::cout << one << std::endl;
will output this:
1