Ad
  • Custom User Avatar

    Exception occurs when the formatted string is not in the correct format (i.e, having leading or trailing spaces or non-digit characters)

    OP solved it, closing...

  • Default User Avatar

    Wondering the same thing I used stoi too. had a string variable add each sqaured number onto the string and return a stoi of that string. but I get error from an exception being caught. Not sure why this isn't allowed.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    When I use std::stoi it catches an exception in the unitttests.
    Is it illegal to use stoi?