开发者

What is the sscanf placeholder for uint8_t types?

What is the sscanf placeholder for uint8_t types? I tried %u, but gcc under OS X doesn't lik开发者_如何转开发e it.


The SCNu8 macro from inttypes.h provides it.

Also note that C has string literal concatenation, i.e. this works:

scanf("%d %" SCNu8 " %d", &int_a, &uint8_t_b, &int_c);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜