Kum*_*lok 1 c bit-manipulation
请详细解释<<和<< =以及>>和>> =之间的区别.我知道转换运算符是如何工作的,但是当谈到>> =或<< =时,我对它们并不那么肯定.
好吧,<<只剩下左转.<<=左转并分配.
<<=是<<什么+=是+.
正如MByD所建议的,这是一个例子
int x = 1;
/* Print 32. */
printf("%d\n", x << 5);
/* x stays the same. */
printf("%d\n", x);
x <<= 5;
/* x has become 32. */
printf("%d\n", x);
Run Code Online (Sandbox Code Playgroud)