hey, just some question, what if stoi has an error ?
does it return boolean like sstream ?
because I failed at using stoi for something I succeed with sstream.
1 2 3 4 5 6 7 8 9 10 11 12 13
#include <iostream>
#include <string>
usingnamespace std;
int main()
{
string input;
cin >> input;
if (stoi(input) == true) cout << "you entered integer\n";
else cout << "you entered random sh*t\n";
cout << "press enter to exit\n";
cin.ignore();
}