NOT运算符使用的符号. [英] Symbol used for NOT operator.

查看:210
本文介绍了NOT运算符使用的符号.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C语言中哪个符号用作not运算符?

Which symbol is used as a not operator in the C language?

推荐答案

用于逻辑非的符号是!而用于按位不的是~

请参见下面的示例:

The symbol used for logic not is ! and the one used for bitwise not is ~

See the example below:

bool b1 = true;
bool b2 = false;
char m = 0x12; // i.e. 00010010 in binary
char n = ~m;   // m will be 0xED, i.e. 11101101 in binary

// Test if b1 is true AND b2 is NOT true
if (b1 && !b2)
{
   ...
}


有关C运算符的说明,请参见此内容.

http://c.comsci.us/etymology/operator/logicalnot.htm [ ^ ]
See this for clarity of C operators.

http://c.comsci.us/etymology/operator/logicalnot.htm[^]


该不是运算符为:-!" :laugh:
The not operator in is:- "!" :laugh:


这篇关于NOT运算符使用的符号.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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