So I need to store user inputs in a vector until he entersa blank line (or an invalid input). I've tried to convert the input to string, then compare it to a blank line, but it didn't work. Here's the code:
int input;
vector<int> v;
do
{
cout << "Write a number!" << endl;
cin >> input;
v.push_back(input);
} while (to_string(input) != "");
Is there any way to do that?
UPDATE
Thank you guys so much for your help! The second answer solved all of my problems and the first one helped me to understand the logical background of it.