C++中 <iso646.h>头文件

1 #include<iostream>
2 #include<iso646.h>
3 using namespace std;
4 int main(){
5     int i = 5,j = 6,k=7;
6     if(i<j and j<k)cout<<"i<j and j<k"<<endl;
7     if(i<j or j<k)cout<<"i<j or j<k"<<endl;
8 }

iso646.h  头文件中包含许多宏定义

#define and &&
#define and_eq &=
#define bitand &
#define bitor |
#define compl ~
#define not !
#define not_eq !=
#define or ||
#define or_eq |=
#define xor ^
#define xor_eq ^=

所以可以使用一些英文单词来表示逻辑符。

原文地址:https://www.cnblogs.com/teng-IT/p/5974025.html