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

nev*_*ing 1 c printf visual-c++

我只能找到小c的参考资料。我假设大写的 C 代表 Unicode,但我不确定。对于较小的数字,两者输出相同的字符。

Ind*_*000 5

来自 MSDN:

%C

type: int or wint_t 
Run Code Online (Sandbox Code Playgroud)

与 printf 函数一起使用时,指定单字节字符;与 wprintf 函数一起使用时,指定宽字符。

%C

type: int or wint_t
Run Code Online (Sandbox Code Playgroud)

与 printf 函数一起使用时,指定宽字符;与 wprintf 函数一起使用时,指定单字节字符。

有关格式说明符的更多信息请参见此处