字符转换为宽字符,来自csdn论坛回帖 wchar_t * wc = new wchar_t[str.size()]; swprintf(wc,L"%S",str.c_str()); //注意大写S。。 wcout<<wc<<endl;