What is the meaning of '==' in C?

前端 未结 5 927
暗喜
暗喜 2021-01-18 11:30

What is the meaning of == and how does it differ from =?

How do I know which one to use?

5条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-18 11:45

    a == b is a test if a and b are equal.

    a = b is called an assignment, which means to set the variable a to having the same value as b.

    (You type | with Shift-\ in the US keyboard layout.)

提交回复
热议问题