if (int & int)

  • Thread starter Thread starter Dirk Reske
  • Start date Start date
D

Dirk Reske

hello,

how can I express this C++ statement in C#

const DETAILS = 2;

if (support & DETAILS)
{
.....
}
 
It's almost the same:

const int DETAIL = 2;
const int CHECK = 0; //or 1 or whatever you need

if ((support & DETAIL) == CHECK)
{
....
}
 
Mountain Bikn' Guy was nearly right, but let me correct him:

It's almost the same:

const int DETAIL = 2;
const int CHECK = 0; //or 1 or whatever you need (Not needed)

if ((support & DETAIL) == DETAIL )
{
....
}
there is also:
if ((support & DETAIL) != 0)
{
....
}
 
I guess it's been too long since I looked at C++

Mountain Bikn' Guy was nearly right, but let me correct him:

It's almost the same:

const int DETAIL = 2;
const int CHECK = 0; //or 1 or whatever you need (Not needed)

if ((support & DETAIL) == DETAIL )
{
....
}
there is also:
if ((support & DETAIL) != 0)
{
....
}
 
Back
Top