Hi ::- ). Assume you have two integers, a = 8, b = 2. In C++ a | b is true. I used that behavior to work with collections of flags. For example the flags would be 1, 2, 4, 8 and so on, and any collection of them would be unique. I can't find how to do that in C#, as the | and & operators don't behave like they would in C++. I read documentation about operators in C# but I still don't get it.
EDIT:
Unfortunately, I seem to mess things up somewhere. Take this code for example:
byte flagCollection = 8;
byte flag = 3;
if ((flag | flagCollection) != 0) MessageBox.Show("y"); else MessageBox.Show("n");
This returns "y" for whatever value I put in flag. Which is obvious, because 3 | 8 would be 11. Hmmmm... what I want to do is have a flag collection: 1, 2, 4, 8, 16 and when I give a number, to be able to determine what flags is it.