How to use the & operator in C#? Is the the translation of the code correct?

前端 未结 3 372
时光说笑
时光说笑 2021-01-20 15:31

the line \"if(arg2 & 1)\" in C++(arg2 is DWORD) is equal to \"if(arg2 & 1==0)\" in C#(arg2 is Uint32),right?

I am trying to translate a function from C++ to

3条回答
  •  终归单人心
    2021-01-20 15:56

    5 - It means both. Because LowPart and HighPart are just "windows" into QuadPart's memory, when result.LowPart == 1 and Result.HighPart == 0, then result.QuadPart will be equal to 1.

提交回复
热议问题