==, ≠, ||, &&, ! 비교문에 대한 디파인을 재정의

Untitled

// 파이썬처럼 비교 연산문을 쓰기 위해 디파인으로 재정의
// CPP의 경우 or, and 연산자는 이미 지정되어 있기 때문에 __cplusplus 옵션 달아줌
#define is ==
#define isnot !=
// #define None (void *)0
#ifndef __cplusplus
// CPP 예약어 or, and, not의 경우 g++ 컴파일 시 제외되도록 처리함
#define or ||
#define and &&
#define not !
#endif

is not or and 명령어 사용 가능

Untitled