Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
Visual C++
Header Files
<string>
<string> Typedefs
 wstring

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Visual C++ Standard Library
wstring

A type that describes a specialization of the template class basic_string with elements of type wchar_t as a wstring.

typedef basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> > wstring;
// string_wstring.cpp
// compile with: /EHsc
#include <string>
#include <iostream>

int main( ) 
{
   using namespace std;
   // Equivalent ways to declare an object of type
   // basic_string <wchar_t>
   const basic_string <wchar_t> s1 ( L"abc" );
   wstring s2 ( L"abc" );   // Uses the typedef for wstring

   // Comparison between two objects of type basic_string <wchar_t>
   if ( s1 == s2 )
      cout << "The strings s1 & s2 are equal." << endl;
   else
      cout << "The strings s1 & s2 are not equal." << endl;
}
The strings s1 & s2 are equal.

Header: <string>

Namespace: std

Reference

Other Resources

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker