一个敏感的问题
杂把字符的ASCII值用二进制显示出来?
//把字符的ASCII值用二进制显示出来? #include <stdio.h>
#define MAXSIZE 8
void shou_ascii();
void shou_ascii() { char c; int i=0; int arry[MAXSIZE]={0}; printf("please enter the character:\n"); c=getchar(); fflush(stdin); while(c>0) { arry[i]=c%2; c=c/2; i++; } i--; printf("the ascii output is :\n"); for(;i>=0;i--) printf("%d",arry[i]); printf("\n"); }
void main() { shou_ascii(); }