The basic idea behind this was to do like this...
std::istringstream in{"",ios::ate};
while(in.empty()){
//copy contents of 'cin' stream into the 'in'
}
I read a bit about streams, in Bjarne's book (mainly on how to use them), and also read some answers on stackoverflow, about copying contents of streams, and from an istream object to a istringstream object, but they didn't actually had any effect, and one more problem was that if i used getline(), it would wait for input, even if the delimiter is set to ' ', while i didn't wanted it to wait. *I tried running a for loop, and checking if the keyboard hits during that time, get into cin, and they did, but then still getline(cin, str, ' ') wait. With the main question in title, why does getline(cin,str,' ') wait, even though cin has spaces?