4 ms·
Shifting is used to define masks. Did you mean you actually type out mask values in base 10?
by fyolnish 10y ago
Shifting is used to define masks. Did you mean you actually type out mask values in base 10?
- cstrahan 10y ago> Did you mean you actually type out mask values in base 10? I believe that's what they meant. I worked in C# for many years, and many, many places wrote out bit masts in base 10 literals as no one realized they could just left-shift. Similarly, whenever I would use the ?? (null-coalescing) operator, the reviewer would inevitably point out my "syntax error", at which point I'd have to point them at the ~10th page of the nearest C# book to convince them that, yes, that is one of the valid operators -- and it's quite useful too! Man, do I miss those first years of my career working in .NET -- dunno why I ever switched to OSS stuff.
- readams 10y agoHex literals work pretty well for defining masks.