什么是uint8_t有类型sscanf的占位符? [英] What is the sscanf placeholder for uint8_t types?

查看:2202
本文介绍了什么是uint8_t有类型sscanf的占位符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是uint8_t有类型sscanf的占位符?我试过%U,但在OS X的gcc不喜欢它。

What is the sscanf placeholder for uint8_t types? I tried %u, but gcc under OS X doesn't like it.

推荐答案

inttypes.h SCNu8 宏提供它。

另外请注意,C有字符串拼接,即这个作品:

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

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

这篇关于什么是uint8_t有类型sscanf的占位符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆