首页 > 解决方案 > 何时在 c 中使用 True not 或等等来代替 &&、||、!=、= 等运算符

问题描述

我的意思是我注意到实际的单词确实存在于 C 中,并且在我编写它们时会亮起,但是我如何使用它们而不是像== != && ||.语法只是为了解释我的意思):

if not(stuff==3 and otherStuff==5)
  printf("something");
else if(statement==false)
  printf("some else");

标签: coperators

解决方案


Stack Overflow 上的新荧光笔非常糟糕。但是您也可以在 C 中使用andandnot来满足您的需要#include <iso646.h>

不过,它们不是关键字,而是宏。


推荐阅读