title: Checking the int limits in stoi() function in C++
body: <p>I have been given a string y in which I'm ensured that it only consists digits. How do I check if it exceeds the bounds of an integer before storing it in an int variable using the stoi function?</p>
  
  <pre><code>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?
  </code></pre>