2009-07-22から1日間の記事一覧

stringとwcharの変換

C++

自分用メモ。ああああ、C++で文字列めんどくせえええ。 #include <iostream> #include <string> #include <vector> #include <locale> #include <cstdlib> using namespace std; void narrow(const std::wstring &src, std::string &dest) { char *mbs = new char[src.length() * MB_CUR_MAX + 1]; wcsto</cstdlib></locale></vector></string></iostream>…