<2024年7月>
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

统计

  • 随笔 - 4
  • 文章 - 0
  • 评论 - 1
  • 引用 - 0

常用链接

留言簿

随笔档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜

re: 字符集相关问题 hzpfly 2010-07-15 09:31
如果中英文混排的情况如何转换成宽字符呢?
const char* str = "I 服了 You";
楼上思路不清
return n&(n - 1) and
return n&&(n&(n - 1)) are all wrong!
Example:
n = 110, n-1 = 101, we have n&(n-1) = 100.
So n&(n-1) is not zero, the return value is true.
We all know 110 is not 2^n.
-2^n 不是 2 的幂。所以很多回复如
return n&(n - 1)
或者
return n && (n&(n - 1))
的前提是要把 n 声明为无符号整数。