摘要: C的输出有10进制,8进制,16进制,如果有时候需要二进制的表示呢?ANSI C中没有二进制的输出形式,我们可以用自定义的函数来完成这部分的操作。#include "stdio.h"#include "limits.h"int IntegerToBinary(int, char[], int);void main(){ int i; char c[32] = {0}; if (IntegerToBinary(10, c, 32)) { for (i=0; i<32; ++i) { putchar(c[i]); } putchar('\n&# 阅读全文
posted @ 2011-03-09 23:28 hami 阅读(4492) 评论(1) 推荐(0)