Sin*_*acı -2 c operators ampersand
我正在准备编程竞赛,我偶然发现了下面的问题.
void main(){
int number, result;
scanf("%d",&number);
result=number-(number&-number); //this is what i'm struggling to understand
printf("%d",result);
}
Run Code Online (Sandbox Code Playgroud)
请注意在注释行中使用"& - ".我无法弄清楚它的功能.我尝试使用谷歌搜索和逆向工程,但我找不到任何东西.
此外,问题本身并不是关于确切的输出,因为变量"数字"是动态的.我只需要了解"& - "部分的作用.谢谢!