我的代码下面给出了奇怪的输出。解释

我的代码下面给出了奇怪的输出。解释

问题描述:

我无法弄清我从下面的代码得到的输出。我的代码下面给出了奇怪的输出。解释

#include <stdio.h> 
int main() 
{ 
    printf("\5"); // This gives a different output 
    return 0; 
} 

输出是♣。

+0

有人请给我解释一下这段代码的输出。输出是♣。 –

+2

你期待输出是什么? – Barmar

+0

什么是输出?你在期待*什么? – Phylogenesis

根据您当前的编码,你会反斜线后有东西时,得到一个特殊字符:

"\5"往往对应查询(“俱乐部”)字符,你可以从here例如找到。

如果你真的想要输出\ 5,你需要把"\\5"