サイト内検索

検索

Shares

Table of Content

!=

[Comparison Operators]

説明

Compares the variable on the left with the value or variable on the right of the operator. Returns true when the two operands are not equal. Please note that you may compare variables of different data types, but that could generate unpredictable results, it is therefore recommended to compare variables of the same data type including the signed/unsigned type.

構文

x != y; // is false if x is equal to y and it is true if x is not equal to y

媒介変数

x: variable. Allowed data types: intfloatdoublebyteshortlong.
y: variable or constant. Allowed data types: intfloatdoublebyteshortlong.

if (x != y) { // tests if x is not equal to y
  // do something only if the comparison result is true
}

Language Reference Home

86Duino のリファレンスのテキストは Arduino レファレンス を編集したもので、 Creative Commons Attribution-ShareAlike 3.0 License下でライセンスされています。リファレンス内のコードサンプルはパブリックドメインとして公開されています。

上部へスクロール