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

标签 c printf visual-c++

只能找小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/

相关文章:

c - MPI_File_Iwrite,将 fprintf 复制到缓冲区

c - 不带 printf 的指针地址 C

c - fopen、fprintf、fclose 的单行代码?

algorithm - 保持两个进程的内存数据结构同步

c++ - 为什么以及何时应调用 _fpreset()?

c - 对堆上结构使用结构初始化语法

c - 为什么会出现段错误? (测试 Shellcode)

c - C语言求第一个正元素和最后一个负元素的位置和值

arrays - 为什么程序在没有接受输入的情况下终止?

c - libcrt 源代码在 VS2017 中的位置?