Convert wstring into string


 There are multiple way to achieve this but I found this piece of code is more useful than anything else.

Code :
string WStringToString(constwstring& s)
{
       string temp(s.length(), ' ');

       std::copy(s.begin(), s.end(), temp.begin());
       return temp;
}

Comments

Popular Posts