c++ - How to read cin with whitespace up until a newline character? -


I would like to read from the current position in the scene to C ++ unless there is a new row in a string. Readable characters may contain spaces My first pass fails because it stops at the first place:

  string result; Cin & gt; & Gt; result;  

If cin is given:

  (cd / my / dir; doSometing) \ n  

variable The result is only:

  (CD  

I think I should be able to use the stream manipulator to complete it, but The skipws were not quite right that it gives the carrios returns with spaces and tabs, and it seems that the skip left whitespace will be left for it.

Need to use a reboot?

  standby buff; cin & gt; buff;  

  std :: string straw; std :: getline (std :: cin, str);  

Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -