Re: Skipws



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

.



Relevant Pages

  • Re: Sets and portability (was) Re: Is ISO Pascal compatible with J&W (original) Pascal ?
    ... strings, the user can control the length by the data they process; ... >> The computer world is more complex than it's ever been (eg Unicode) ... The Pascal `Char' type can be this size (unlike C, ... > Note that ansi->wide conversion is codepage sensitive. ...
    (comp.lang.pascal.misc)
  • Re: How to LPCTSTR Convert to char *
    ... number of people who use 'char' because they've never grown beyond their first programming ... These are the people who are getting nuked by VS2005 which defaults to Unicode apps. ... isolated to the embedded interface (rare and exotic situation imposed by external ... fields with char strings is quite essential. ...
    (microsoft.public.vc.mfc)
  • Re: Unicode strings vs. traditional C strings
    ... Compiler does what you'd expect it to. ... internally with a char *, ... It's really only the Win32 API that is primarily UNICODE. ... T or F - A function such as strchrfor ANSI strings does not exist but I ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Marshal.SizeOf und StringBuilder
    ... weil man unter WinME/Win98 Strings standardmässig ... ANSI marshallt. ... Das müsste unter WinME dann letztlich ANSI also "char" werden. ... Das macht das aber IMHO der Marshalling-Mechanismus: ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: Unable to see Russian Strings in .RC file.
    ... > UNICODE i am not able to see the Russian strings and instead seeing ... I then created a sample MFC app and included _UNICODE ... > atoito wtoietc i.e. use the wide char methods instead of ANSII ...
    (microsoft.public.vc.mfc)

Loading