/* printBits.c ---打印出value的二进制 ** dhfalive 2010.8 dh_fa@live.cn */ void printBits(int value) { int bitsCnt = sizeof(value) * 8; int i; for (i = 0; i < bitsCnt; i++) { printf("%d", value & (1 << (bitsCnt - 1))? 1: 0); value <<= 1; } printf("/n"); return; }