convert char * to wchar_t *

using mbstowcs function

	char psz[] = {"helloworld\0"};
	wchar_t pwsz [10] = {0};
	int len = strlen(psz);
	int ret = mbstowcs(pwsz, psz, min(len, 10));
	cout<<ret<<endl;
	wcout<<pwsz<<endl;
Note: if the dest has less space than src, that will cause the exception. So use






相关文章:

  • 2022-12-23
  • 2021-12-31
  • 2021-09-13
  • 2022-12-23
  • 2021-05-20
  • 2021-09-16
猜你喜欢
  • 2021-12-20
  • 2022-12-23
  • 2021-10-12
  • 2022-12-23
  • 2021-09-13
  • 2022-12-23
  • 2021-06-14
相关资源
相似解决方案