在C中使用and or not代替逻辑算符
在C99之后,用户可以通过引入iso646.h以加入and or not等宏定义,这些宏定义使得用户可以使用更加可读的写法编写复杂判断.iso646.h增加了包括逻辑与或非,算数与或非,算数运算后判断(&=,|=,^=等)的宏定义.示例代码:#include <stdio.h>#include <math.h>#include <iso646.h>int main(){ int a = 0, b = 1, c = 2; print
原创
2021-09-04 11:37:26 ·
304 阅读 ·
0 评论