Using Exclamation Marks '!' in C

前端 未结 5 2036
情歌与酒
情歌与酒 2020-12-05 15:15

I have come across a problem involving exclamation marks and integers whilst reading a code in my reference book.

Let us say I have declared an integer variable name

5条回答
  •  一整个雨季
    2020-12-05 16:04

    It's a negation or "not" operator. In practice !number means "true if number == 0, false otherwise." Google "unary operators" to learn more.

提交回复
热议问题