scanf a big hexadecimal value

前端 未结 1 1373
陌清茗
陌清茗 2021-01-27 03:03

I have a issue trying to use scanf to get a big hexadecimal num (12 chars) from the user.

it seems to only get the last 8 chars, eg - ABFFFFFFFF will become 0000FFFFFFFF

相关标签:
1条回答
  • 2021-01-27 03:15

    You must use "%llx" for both scanf format and printf. See the manual page for additional details.

    0 讨论(0)
提交回复
热议问题