gpt4 book ai didi

c - printf 中的 %c 和 %C 有什么区别?

转载 作者:太空宇宙 更新时间:2023-11-04 00:17:36 25 4
gpt4 key购买 nike

只能找小c的引用。我假设大写字母 C 代表 Unicode,但我不确定。对于较小的数字,两者都输出相同的字符。

最佳答案

来自 MSDN:

%c

type: int or wint_t 

When used with printf functions, specifies a single-byte character; when used with wprintf functions, specifies a wide character.

%C

type: int or wint_t

When used with printf functions, specifies a wide character; when used with wprintf functions, specifies a single-byte character.

关于格式说明符的更多信息 here

关于c - printf 中的 %c 和 %C 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1218371/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com