c++ - 如何将 char 字符串转换为 wchar_t 字符串?

标签 c++ windows string

我有一个 char* 格式的字符串,想将其转换为 wchar_t*,以传递给 Windows 函数。

最佳答案

这个小功能有帮助吗?

#include <cstdlib>

int mbstowcs(wchar_t *out, const char *in, size_t size);

另见 C++ reference

关于c++ - 如何将 char 字符串转换为 wchar_t 字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1791578/

相关文章:

c++ - 为二维char数组分配内存,错误: invalid conversion from ‘void*’ to ‘char**’

c# - FileSystemWatcher 类 - 排除目录

python - 运行子文件夹中的脚本

regex - 如何在 R 中对百分比进行 strsplit

ruby - Ruby 字符串中的自定义 + 方法

c - Pebble SDK - 带字符串的结构数组(可能还有指针)

c++ - 在c++中构造围绕中心元素的镜像 vector

c++ - Visual Studio,Xutility错误

c++ - DLL 中使用的全局变量

python - 检测硬件图形支持