!=演算子の代替スペル。
構文
#define not_eq !=
解説
C++:
not_eqは、!=の代わりに使用できます。/permissive-または/Zaコンパイラ オプションが必要です。<iso646.h>または<ciso646>を含むのは非推奨です。 ヘッダー ファイルを含めずに、代替スペル を使用できます。==の代わりのスペルはありません。
C:
not_eqは、!=の代替スペル です。<iso646.h>ではマクロとして提供されるため、#includeする必要があります。==の代わりのスペルはありません。
例
// compile with: /EHsc
#include <iostream>
#include <iso646.h>
int main( )
{
int x = 1, y = 2;
// not_eq is available in C++ and C
// This example is for C++, so no header file is needed to use not_eq
// When compiling for C, #include <iso646.h> to use not_eq
if (x not_eq y)
{
std::cout << "Not equal\n";
}
}
Not equal
要件
C 用にコンパイルする場合は、Header: <iso646.h> が必要です。