我得到了一个字符串 y,我确保它只包含数字。在使用 stoi 函数将其存储在 int 变量中之前,如何检查它是否超出了整数的范围?
string y = "2323298347293874928374927392374924"
int x = stoi(y); // The program gets aborted when I execute this as it exceeds the bounds
// of int. How do I check the bounds before I store it?