printf打印u8
时间: 2023-08-19 10:06:29 浏览: 209
printf打印u8时,可以使用%hhu格式化符号。u8是无符号的8位整数,可以打印出对应的ASCII码值。所以可以使用以下代码进行打印:
```c
u8 value = 65; // 假设要打印的值是65
printf("%hhu\n", value);
```
这样就可以打印出65对应的ASCII码值。
#### 引用[.reference_title]
- *1* [C 语言printf打印各种数据类型的方法(u8/s8/u16/s16.../u64/double/float)(转)](https://blog.csdn.net/yikunbai5708/article/details/102002558)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* *3* [C语言用printf()打印u8,u16,u32等参数类型](https://blog.csdn.net/weixin_44261839/article/details/114029128)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文