Unexpected unsigned integer behavior

前端 未结 2 1238
后悔当初
后悔当初 2021-01-16 05:22

I encountered this unexpected output with the following code in which I was verifying the maximum values (represented in decimal form) of the unsigned forms of short and int

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-16 05:44

    You need to use %u for the format specifier for an unsigned type.

提交回复
热议问题