compl

~ 연산자에 대한 대안입니다.

구문

#define compl ~

설명

매크로가 ~ 연산자를 생성합니다.

예시

// iso646_compl.cpp
// compile with: /EHsc
#include <iostream>
#include <iso646.h>

int main( )
{
   using namespace std;
   int a = 1, result;

   result = ~a;
   cout << result << endl;

   result= compl(a);
   cout << result << endl;
}
-2
-2

요구 사항

헤더:<iso646.h>