如何解决警告:Linux C ++中的多字符字符常量 [英] How to resolve warning: multi-character character constant in Linux C++

查看:3195
本文介绍了如何解决警告:Linux C ++中的多字符字符常量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

#ifdef WIN32
#   define TARGET_OS 'W_NT'


$ b b

我得到C ++警告在Linux多字符字符常量。在下面一行。如何解决此警告。

I am getting C++ warning in Linux multi-character character constant. at the below line. How to resolve this warning.

#if TARGET_OS == 'W_CE'


推荐答案

字符串常量使用双引号,单引号用于字符常量。

String constants use double quotes, single quotes are for character constants.

要禁止警告,如果这是你的意思,你可以使用 -Wno-multichar gcc选项。

To suppress the warning if this is what you mean you can use -Wno-multichar gcc option.

这篇关于如何解决警告:Linux C ++中的多字符字符常量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆