skipws manipulator

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • thomas

    skipws manipulator

    // ws manipulator example
    #include <iostream>
    #include <sstream>
    using namespace std;

    int main () {
    char a[10], b[10], c[10];

    istringstream iss (" one \n \t two");
    iss >noskipws;
    iss >a >skipws >b >c;
    cout << a << "," << b <<"."<<c<< endl;

    return 0;
    }
    --------------
    output: ",."
    I expected: " ,one.two";
    a=" " (noskipws)
    b="one"(skipw s)
    c="two"(skipw s)

    Anything I missed?
  • Victor Bazarov

    #2
    Re: skipws manipulator

    thomas wrote:
    // ws manipulator example
    [..]
    Anything I missed?
    What your mother told you about patience, maybe?...

    Comment

    Working...