noskipws stringstream

closed account (1RDz3TCk)
Hello everybody

i have the following question:

"Hello world" to cin and the following code

string str,msg;
getline(cin,str)
stringstream ss(str);
char c;
while(ss >> noskipws >> c)
msg += c;

results in msg = "Hello World"

but if i use string c instead of char c, msg is empty

Does anyone on you know why ?

Kind regards


Thomas
Topic archived. No new replies allowed.