Re: Skipws
- From: George <George@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 3 Mar 2008 01:21:01 -0800
Thanks Ulrich,
I have tested skipws works for both ANSI and UNICODE version strings (i.e.
char and wchar_t). Looks like the word "space" means both ANSI and UNICODE
space as you quoted, right? :-)
[Code]
#include <string>
#include <sstream>
using namespace std;
int main()
{
istringstream istr;
istr.str(" hello");
string str;
istr >> std::skipws >> str; // str is "hello"
wistringstream wistr;
wistr.str(L" hello");
wstring wstr;
wistr >> std::skipws >> wstr; // str is L"hello"
return 0;
}
[/Code]
regards,
George
"Ulrich Eckhardt" wrote:
George wrote:.
skipws works for both char based and wchar_t based string stream? I have
not found formal clarification from MSDN.
http://msdn2.microsoft.com/en-us/library/98bsd5x4.aspx
"Cause spaces to not be read by the input stream."
I wouldn't say this is ambiguous, what makes you think so? Otherwise, have
you tried it? I know that some older VCs had a buggy implementation.
Uli
--
C++ FAQ: http://parashift.com/c++-faq-lite
Sator Laser GmbH
Geschäftsführer: Michael Wöhrmann, Amtsgericht Hamburg HR B62 932
- Follow-Ups:
- Re: Skipws
- From: Ulrich Eckhardt
- Re: Skipws
- References:
- Skipws
- From: George
- Re: Skipws
- From: Ulrich Eckhardt
- Skipws
- Prev by Date: Re: capacity and reserve
- Next by Date: Re: Skipws
- Previous by thread: Re: Skipws
- Next by thread: Re: Skipws
- Index(es):
Relevant Pages
|
Loading