Global Trend Radar
Web: learn.microsoft.com US web_search 2026-05-01 02:29

等価演算子: == と != | Microsoft Learn

原題: Equality operators: == and != | Microsoft Learn

元記事を開く →

分析結果

カテゴリ
AI
重要度
54
トレンドスコア
18
要約
この記事では、プログラミングにおける等価演算子「==」と「!=」の使い方について説明しています。「==」は二つの値が等しいかどうかを比較し、「!=」は二つの値が等しくないかを判断します。これらの演算子は条件文やループで頻繁に使用され、プログラムの論理を構築する上で重要な役割を果たします。
キーワード
Equality operators: == and != | Microsoft Learn Table of contents Exit editor mode Ask Learn Ask Learn Reading mode Table of contents Read in English Add Add to plan Edit Copy Markdown Print Note Access to this page requires authorization. You can try signing in or changing directories . Access to this page requires authorization. You can try changing directories . Equality operators: == and != Feedback Summarize this article for me Syntax expression == expression expression != expression Remarks The equal-to operator ( == ) returns true if both operands have the same value; otherwise false . The not-equal-to operator ( != ) returns true if the operands don't have the same value; otherwise false . In C and C++, not_eq can be used as alternative to != . For more information, see not-eq . Example #include <iostream> int main() { int x = 1, y = 1, z = 2; if (x == y) { std::cout << "Equal\n"; } if (x != z) { std::cout << "Not equal\n"; } } Equal Not equal See also not-eq Operator overloading Expressions with binary operators C++ built-in operators, precedence; and associativity C relational and equality operators Feedback Was this page helpful? Yes No No Need help with this topic? Want to try using Ask Learn to clarify or guide you through this topic? Ask Learn Ask Learn Suggest a fix? Additional resources Last updated on 2024-08-12 Was this page helpful? Yes No No Need help with this topic? Want to try using Ask Learn to clarify or guide you through this topic? Ask Learn Ask Learn Suggest a fix?

類似記事(ベクトル近傍)