i have been trying to make a program that checks if a national identification number is valid how ever i have run into a issue and i can't find an answer anywhere. I am using a string to store the users input of the identification code and i need to somehow covert the string to int keeping the symbol instead of getting an ascii value.
Example: (lets say the user inputs the string persKods as 111199-11111 the 5th symbol is 9 so the year value should output as 9 instead of 54 which is its ascii value)
int day,month,year;
year=this->persKods.at(4);
cout << year; // it outputs 54 instead of 9 :/