小知识
wangyi1015
~
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
内存对齐
// Structure Size example#include struct A { char a; long b; char c; long d; } ;struct B { char a; char c; long b; long d; } ;#pragma pack(push,1)struct C { char a; long b; ch原创 2009-03-15 19:19:00 · 507 阅读 · 0 评论 -
变量运算速度
整型在除法是要做转换,在其他运算中有明显的速度优势原创 2009-03-15 19:26:00 · 537 阅读 · 0 评论 -
转移表
// Table definition:typedef long (*functs)(char c);functs JumpTable[] = { DoOne,DoTwo,DoThree /* etc*/} ;// some code that uses the table:long result = JumpTable[selector](i++);转移表的内在的基本思路在于:将待调用函数的原创 2009-03-15 19:49:00 · 571 阅读 · 0 评论 -
比特域
struct BitField{ unsigned rangeAOne : 11; // long 1; unsigned rangeATwo : 11; unsigned rangeBOne : 10; unsigned rangeAThree : 11; // long 2; unsigned rangeAFour :原创 2009-03-15 19:37:00 · 648 阅读 · 0 评论
分享