Day 16: Exceptions - String to Integer

  • + 3 comments

    no need to define a int value, just cout

    try{
        cout<<stoi(S);
    }
    catch(...){
        cout<<"Bad String";
    }