What double negation does in C

后端 未结 5 681
谎友^
谎友^ 2021-01-14 05:34

I had a controversy about what compilers \"think\" about this:

a = 8;
b = !!a;

So, is b == 0x01 ? Is TRUE always

5条回答
  •  旧时难觅i
    2021-01-14 06:09

    In teems of speed I think this is highly dependent on the compiler and processor you are using.

    The longer expression would produce an executable 4 - 16 bytes larger.

提交回复
热议问题