I'm struggling with reading characters from console in c++. Here is what I tried to do:
char x;
char y;
char z;
cout<<"Please enter your string: ";
string s;
getline(cin,s);
istringstream is(s);
is>> x >> y >> z;
The problem is if the user enter something like this "1 20 100":
x will get 1
y will get 2
z will get 0
What I want to get is x = 1; y = 20; z = 100;
Anybody has suggestions?