摘要: Matlab中有与、 或、 异或的操作 bitand,bitor,bitxor:bitandBitwise ANDSyntaxC = bitand(A, B)DescriptionC = bitand(A, B) returns the bitwiseAND of arguments A and B, where A and B areunsigned integers or arrays of unsigned integers.ExamplesExample 1The five-bit binary representations of the integers 13 and 27 are 阅读全文
posted @ 2013-03-08 08:43 boys2012 阅读(4445) 评论(0) 推荐(0) 编辑
摘要: tag>内存对齐 结构体大小 sizeof</tag>前几天为了做ppt,而写了一个处理bmp文件的小程序,没想到一个小程序,竟然忙乎了我半天。最后才发现,我是栽到了结构体在内存对齐的问题上。比如说,下面这个结构体,用sizeof函数,得到的结果是12.为什么呢?typedef struct _C{char a;int b;char c;}C;这是因为x86系统下,结构体会发生内存对齐操作,这是为了cpu存取数据速度快而设定的。在上述的结构体中,块头最大的是int b,占4个字节,所以整个结构体就占12个字节。typedef struct _D{char a;double b 阅读全文
posted @ 2013-03-08 08:30 boys2012 阅读(499) 评论(0) 推荐(0) 编辑