Converting bitwise AND/NOT from VB.NET to C# -
original code (vb.net):
curstyle = curstyle , (not es_number)
changed code (c#):
curstyle = curstyle & (!es_number);
but giving me error:
operator '!' cannot applied operand of type 'long'
es_number of data type long. tried changing int, string, etc. doesn't work.
how solve problem?
and
same &
; got correctly. not
in front of long
bitwise not operator. c# equivalent ~
.
the c# code be:
curstyle = curstyle & (~es_number);
check out bitwise operators in c# or(|), xor(^), and(&), not(~) , explaining c# bitwise operators.
Comments
Post a Comment