Last active
December 16, 2015 23:49
-
-
Save szolotykh/1c279600c4a18568ab2c to your computer and use it in GitHub Desktop.
Function of converting char to wchar_t
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Convert char to wchar_t | |
bool char2wchar_t(char *str1, wchar_t *str2){ | |
std::wstringstream st; | |
st << str1; | |
return !(st >> str2).fail(); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sstream> | |
char cStr[]="Hello"; | |
wchar_t wStr[10]; | |
char2wchar_t(cStr,wStr); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment