Friday, February 12, 2010

Using stl strings std::string with Windows wide characters

This is much easier than it sounds for example:

#include < string >
#include < algorithm >

//Make a wide char string type.
typedef std::basic_string< wchar_t > wstring;

// initialize a wstring
wstring ws = L"Hello World";

// make the string lower case
std::transform(ws.begin(),ws.end(),ws.begin(),tolower);

chris' shared items

Twitter Updates

Official blog of Chris Lee Runyan

Fastest C++ in the west.