c# - What does a BitWise OR ("|") mean when used with a return statement? -
in c#.net, has ever seen return statement inside method looks this?
protected override buttons getbuttonstoshow() { return buttons.new | buttons.return | buttons.delete; }
how bitwise operator "|" working here? result of statement? know how bitwise operators work in if ... else ... statements , such, i've never seen used way.
this makes bit-mappable can use bitwise operators combine values.
in case returns value bitmap combining of 3 options.
this blog post has quite clear explanation (though uses &
example).
Comments
Post a Comment