and 연산자
#include
#ifdef ____________
궁굼한것은 && 연산자와 & 연산자의 차이점에 대해서 이다..
16진수와 10진수 그리고 bool 에 대한 것을 확인해보고싶다.
켁 && 은 둘다 참이면 1
|| 둘중에 하나라도 참이면 1
그러니까.. 0이아니면 참이구… 그럼 아래는 다 1이 되어야하는군 케케케
& , | 는 비트 연산자이군….
#endif
//#define boolean bool
int main(int argc, char *argv[])
{
int test_first =0x22;
int test_second = 0x11;
// boolean TEST_FALSE = 0;
// boolean TEST_TRUE = 1;
printf(“%d && %d = %d
“,test_first, test_second, test_first && test_second);
printf(“%d & %d = %d
“, test_first, test_second, test_first & test_second);\
printf(“%d || %d = %d
“,test_first, test_second, test_first || test_second);
printf(“%d | %d = %d
“, test_first, test_second, test_first | test_second);
return 0;
}
\