时间:2022-03-03 09:47:55 | 栏目:C代码 | 点击:次
int main (void)
{
unsigned int MAX = 32;
unsigned int index = 31;
index = 31;
index = (index + 1) % MAX; // 这个容易理解
printf ("index = %d\n", index);
index = 31;
index = (index + 1) & (MAX - 1); // 这个运算效率高
printf ("index = %d\n", index);
return;
}