반응형

논리 연산자

if (a==0 && b==0){} &&     a가 0 이고 b 0 일때 처리 and
if (a==0 || b==0){};       ||        a가 0 이거나 b 0 일때 처리 or
if (a!=0){};                        !=      a가 0이 아닐때 처리

if (!theBool){}                      theBool 이 false 면 처리


비트 연산자
int c=a & b;       &    비트연산자 and
int c=a | b;         |     비트 연산자 or

int a=a ^ 31;       ^   비트연산자 xor

int a=a ~31        ~   비트연산자 not

 

int a=b << 2   <<   비트 연산자 shl
int a=b >> 2;     >>   비트 연산자 shr

 

C++ 논리 연산자 and or not, 비트 연산자 and or xor not 

반응형

+ Recent posts