10 2014 档案
C/C++指针知识整理(一)
摘要:1.指针(变量)的类型把指针声明语句里的指针名字去掉,剩下的部分就是这个指针的类型。这是指针本身所具有的类型。(1)int*ptr;//指针的类型是int*(2)char*ptr;//指针的类型是char*(3)int**ptr;//指针的类型是int**(4)int(*ptr)[3];//指针的类... 阅读全文
posted @ 2014-10-22 19:59 码哥@杭州 阅读(160) 评论(0) 推荐(0)
计算二进制数末尾0的个数
摘要:源自 http://www.matrix67.com/blog/archives/3985unsigned int v;// find the number of trailing zeros in 32-bit vint r;// result goes herestatic const int ... 阅读全文
posted @ 2014-10-19 21:06 码哥@杭州
快速计算一个数的平方根及其倒数
摘要:源自 http://www.matrix67.com/blog/archives/362float Q_rsqrt( float number ){long i;float x2, y;const float threehalfs = 1.5F;x2 = number * 0.5F;y= numbe... 阅读全文
posted @ 2014-10-19 20:52 码哥@杭州