vector<int> var;
int numb;
cout<<"Enter number: ";
while (cin>>numb) {
if (cin.get()==char(32)) {
var.push_back(numb);
shellsort(var);
for (int i=0; i<var.size(); i++) {
cout<<var[i]<<" ";
}
} else if (cin.get()=='\n') {
break;
}
}
I used ascii code 32 to read space and a sort function. Loop the value to show current list. The problem is the current sorted list wont show during input of value. What to do?