Why use hex?

前端 未结 12 2027
你的背包
你的背包 2020-11-28 03:45

Hey! I was looking at this code at http://www.gnu.org/software/m68hc11/examples/primes_8c-source.html

I noticed that in some situations they used hex numbers, like i

12条回答
  •  猫巷女王i
    2020-11-28 04:12

    Looking at the file, that's some pretty groady code. Hope you are good at C and not using it as a tutorial...

    Hex is useful when you're directly working at the bit level or just above it. E.g, working on a driver where you're looking directly at the bits coming in from a device and twiddling the results so that someone else can read a coherent result. It's a compact fairly easy-to-read representation of binary.

提交回复
热议问题