K
Kevin Grigorenko
That's a rethorical question. But shouldn't this statement store the value
of three in the variable a:
#include <iostream>
int main()
{
int a = 1 & 2;
if(a & 1)
{
std::cout << "One " << std::endl;
}
if(a & 2)
{
std::cout << "Two " << std::endl;
}
return 0;
}
I'm trying to use bit-masking to pass around flags with an integer, and then
check them with if( integer & flagX )
What is going on?
Thanks a lot for your time,
Kevin Grigorenko
of three in the variable a:
#include <iostream>
int main()
{
int a = 1 & 2;
if(a & 1)
{
std::cout << "One " << std::endl;
}
if(a & 2)
{
std::cout << "Two " << std::endl;
}
return 0;
}
I'm trying to use bit-masking to pass around flags with an integer, and then
check them with if( integer & flagX )
What is going on?
Thanks a lot for your time,
Kevin Grigorenko