次のようなバイナリ表現について混乱しています0b10101
:
#include <stdio.h>
int main(void) {
int a,b;
b = 0b101;
scanf("%i",&a);
printf("the value of a is %d\n", a);
printf("the value of b is %d\n", b);
}
入力すると0b101
、
出力は私に与える
the value of a is 0;
the value of b is 5;
あるべき2つの5の代わりに。
scanf
バイナリ入力を取得する方法はありますか?