Reverse bit pattern in C

后端 未结 6 1638
猫巷女王i
猫巷女王i 2021-01-05 05:16

I am converting a number to binary and have to use putchar to output each number.

The problem is that I am getting the order in reverse.

Is the

6条回答
  •  余生分开走
    2021-01-05 06:10

    My guess is that you have a integer and you're attempting to convert it to binary?

    And the "answer" is ABCDEFG, but your "answer" is GFEDCBA?

    If so, I'd double check the endian of the machine you're doing it on and the machine the "answer" came from.

提交回复
热议问题