unsigned int a;
unsigned int b;
unsigned int mask; // 如果是1则从b里选,否则从a里选。.
unsigned int r;
r = a ^ ((a ^ b) & mask);
按mask合并两个位串
最新推荐文章于 2023-04-13 15:57:17 发布
unsigned int a;
unsigned int b;
unsigned int mask; // 如果是1则从b里选,否则从a里选。.
unsigned int r;
r = a ^ ((a ^ b) & mask);