How do I read hex numbers into an unsigned int in C

前端 未结 5 956
被撕碎了的回忆
被撕碎了的回忆 2020-12-17 04:59

I\'m wanting to read hex numbers from a text file into an unsigned integer so that I can execute Machine instructions. It\'s just a simulation type thing that looks inside

5条回答
  •  孤街浪徒
    2020-12-17 05:26

    In this case, all of your input is upper case hex while you are trying to read lower case hex.

    To fix it, change %x to %X.

提交回复
热议问题