I was wondering is it safe to do so?
wchar_t wide = /* something */; assert(wide >= 0 && wide < 256 &&); char myChar = static_cast
An easy way is :
wstring your_wchar_in_ws(); string your_wchar_in_str(your_wchar_in_ws.begin(), your_wchar_in_ws.end()); char* your_wchar_in_char = your_wchar_in_str.c_str();
I'm using this method for years :)