Skip to content

Commit

Permalink
docs: 补充比较表达式为什么能用于条件判断
Browse files Browse the repository at this point in the history
  • Loading branch information
FeignClaims authored Nov 2, 2024
1 parent 0d218b3 commit e04e63b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions faq/condition/main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@

:cpp:`bool` 类型只有两个值, :cpp:`true` 为真, :cpp:`false` 为假.

.. code-block:: cpp
:linenos:
int value = 1;
if (value == 1) { // value == 1 表达式返回 bool 类型, 可以用于条件判断
}
.. code-block:: cpp
:linenos:
Expand Down

0 comments on commit e04e63b

Please sign in to comment.