J
joe
Has anyone have any ideas for a possibly more efficient approach to
conditionally executing code based on bits being set (to zero)?
example attempt: If the particular bit is set to 0, do something (in
this case increment a particular output)
void foo(int input,int* output)
{
if( !(input & 1) )
{
output[0] ++;
}
if( !(input & 2) )
{
output[1]++;
}
if( !(input & 4) )
{
output[2]++;
}
..etc..
}
}
conditionally executing code based on bits being set (to zero)?
example attempt: If the particular bit is set to 0, do something (in
this case increment a particular output)
void foo(int input,int* output)
{
if( !(input & 1) )
{
output[0] ++;
}
if( !(input & 2) )
{
output[1]++;
}
if( !(input & 4) )
{
output[2]++;
}
..etc..
}
}