#include <stdio.h>#include <memory.h>typedef struct bitstruct{ int b1:5; int :2; int b2:2;}bitstruct;int main(int argc, char *argv[]){ bitstruct b; memcpy(&b,"EMC Examination",sizeof(b)); printf("%d,%d\n",b.b1,b.b2); return 0;
}
这个题目的输出是5和-2,认真分析了一下,能得到正确答案,但是具体机制不清楚,大家讨论讨论吧
真诚呼唤高手跟我交流,qq:89636669
阅读全文(2742) | 回复(0) | 编辑 | 精华
|