Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > question about skipws manipulator

Reply
Thread Tools

question about skipws manipulator

 
 
thomas
Guest
Posts: n/a
 
      11-05-2008
// 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;
}
----------------------------
I expected the above code will output " ,one.two",
but it is ",."
I think a=" "; -> noskipws
b="one"; --> skipws
c="two"; --> skipws

Anything I missed?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
skipws manipulator thomas C++ 0 11-05-2008 12:47 PM
Skipws George2 C++ 0 03-03-2008 08:29 AM
Manipulator question... barcaroller C++ 9 06-01-2007 02:08 AM
skipws and << Norman Landis C++ 2 12-14-2005 01:11 AM
skipws berkay C++ 1 09-20-2005 12:28 PM



Advertisments