get character from string c++ as int code example Example: char to int c++ int x = (int)character - 48;