since around 2hours im really fighting with the cin command.
It doesn't matter what exactly im trying, it's just not waiting for user input and keeps directly using 0 as "entered" value. What the hell is wrong with this code?:
1 2 3 4
int Value;
cout << "Enter a new value: " << endl;
cin >> Value;
cout << "The value has been set to: " << Value;
#include <stdlib.h>
string str, error;
int Value;
//cout << "Enter a new value: "; // I don't like doing this.
do { cout << "Enter a new value: " << flush;
getline(cin,str);
for(unsignedint i = 0; i<Value.size(); i++) if(isalpha(str[i])) error = "true"; else error = "false";
} while(error == "true");
Value = atoi(str.c_str());
cout << "The value has been set to: " << Value;