Two Equal Signs in One Line?

后端 未结 10 895
北荒
北荒 2020-12-06 04:58

Could someone please explain what this does and how it is legal C code? I found this line in this code: http://code.google.com/p/compression-code/downloads/list, which is a

10条回答
  •  悲&欢浪女
    2020-12-06 05:42

    ArcChar = ArcBit = 0;
    

    The assignment is left-associative, so it's equivalent to:

    ArcChar = (ArcBit = 0);
    

    The result of ArcBit = 0 is the newly-assined value, that is - 0, so it makes sense to assign that 0 to ArcChar

提交回复
热议问题