// converts string to int if string is in integral range int main() { string str1 = "123"; int x = stoi(str1); cout << x; }