c++ - 有没有办法在不使用 L 或 u 字符的情况下编写函数参数(wchar_t 或 char16_t)?
问题描述
我有一个函数,其参数为wchar_t*
or char16_t*
,例如:
void showMsg(char16_t *msg){ // or "wchar_t *msg"
wcout << msg;
}
正如我们所知,我们必须在文本之前使用 L 或 u,如下所示:
showMsg(u"おはようございます"); // for char16_t* must use "u"
showMsg(L"おはようございます"); // for wchar_t* must use "L"
有没有不使用L
oru
字符来编写字符串参数的方法或技巧?
解决方案
推荐阅读
- node.js - 如何添加到集合顶部/从集合底部删除(猫鼬)?
- c# - 使用选择元素 ASP.NET Core MVC 中的属性保存父项和子项
- python - 在 Flask-sqlalchemy 中按订单号在 db 中对数据进行排序
- jitsi - 如果主持人设置了会议密码,Jibri 将无法录制
- python-3.x - 算法 python3 时间效率
- python - 根据条件在列中查找值
- c# - 我如何进行异步数字排序应用程序 WPF
- javascript - 为什么我不能让我的页面附加文本并出现在我的 HTML 页面上?
- c - Visual Studio 中的 ASCII 字符看起来很奇怪
- python - 使用python将嵌套的json文件更改为数据框