Sorry for such a ludicrously n00b question... But what is the bitwise Not operator in C#? In short, Im trying to replicate this VB.Net code in C#:
In C# I tried this:
But the above complains that the ! operator does not apply for Integers. I guess its for booleans only? So what is the easiest way to do this in C#? I cant imagine that I have to resort to a Collections.BitArray, do I?
Much thanks in advance...
Mike
Code:
Dim myInt as Integer = 0
myInt = Not myInt
MessageBox.Show(myInt.ToSting) <-- Reports -1
Code:
int myInt = 0
myInt = !myInt // <-- Compile Time Error
MessageBox.Show(myInt.ToSting)
Much thanks in advance...
Mike