因為常常會用到
但是又常常忘記
在這邊先記下來~~~
char -> wchar_t
#include "stdafx.h"
int main(int argc, char* argv[])
{
char* mychar = "Hello";
wchar_t mywchar[100];
//Translate from char to wchar_t
mbstowcs(mywchar, mychar , strlen(mychar));
}
wchar_t -> char
#include "stdafx.h"
int main(int argc, char* argv[])
{
char mychar[100];
wchar_t mywchar = L"Hello";
//Translate from wchar_t to charwcstombs(mychar, mywchar, wcslen(mywchar));
}
留言
張貼留言