如何寻址 C4428 Visual C++ 的此实例关于字符文字的警告?

发布于 2024-11-29 23:33:40 字数 396 浏览 3 评论 0原文

目前 Visual C++ 出现 C4428 警告

源中遇到的通用字符名

在以下代码的

const wchar_t someMagicValue = L'\ufffd';

我想解决此警告,并且我想知道以下内容是否

const wchar_t someMagicValue = L'\xfffd';

是完全等效的代码。

后面的代码和前面的代码完全等价吗?什么是更好的选择?

Currently Visual C++ issues C4428 warning

universal-character-name encountered in source

on the following code

const wchar_t someMagicValue = L'\ufffd';

I'd like to address this warning and I wonder whether the following:

const wchar_t someMagicValue = L'\xfffd';

will be fully equivalent code.

Will the latter code be fully equivalent to the former? What could be a better option?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

榕城若虚 2024-12-06 23:33:40

正如此处评论的

编译器警告(级别 4)C4428 (VS2010)

这是最有可能/只是 MSVC 中的一个错误/

另请参阅 此线程进行更多讨论

As commented here

Compiler Warning (level 4) C4428 (VS2010)

this is most likely /just a bug/ in MSVC

See also this thread for a bit more discussion

花期渐远 2024-12-06 23:33:40

你试过这个吗?

const wchar_t someMagicValue = 0xfffd;

Have you tried this?

const wchar_t someMagicValue = 0xfffd;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文