C++ ascii 字符 255 是不可见字符还是空格?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21243426/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 23:33:34  来源:igfitidea点击:

Is ascii character 255 an invisible character or space?

c++ascii

提问by Dljcali

I am writing some code to print overlapping ASCII character objects and I want some to be invisible instead of the typical " " white space character. Would this solve it?

我正在编写一些代码来打印重叠的 ASCII 字符对象,我希望一些不可见,而不是典型的“”空白字符。这能解决吗?

cout << char(255);

回答by lou

In the most common extended 8-bit ASCII tables 255 is the '?' symbol (Latin small letter y with diaeresis). The space character is decimal value 32. So what you are searching for is probably:

在最常见的扩展 8 位 ASCII 表中,255 是“?” 符号(带分音符的拉丁小写字母 y)。空格字符是十进制值 32。所以你要搜索的可能是:

cout << char(32);

回答by FlameBlazer

I guess you mean when you press ALT+255.

我猜你的意思是当你按下 ALT+255 时。

And no ALT+255 is not the same as a space.

并且没有 ALT+255 不等于空格。

Here is a table of the characters values.

这是字符值的表。

Char ????????Dec Hex Oct

字符 ????????Dec 十六进制 十月

SPACE ?????32 ??20 ??40

空间 ???32 ??20 ??40

ALT+255??160 ?A0 ?240

ALT+255??160 ?A0 ?240

I don't know much C++ but maybe it is

我不太了解 C++,但也许是

cout << char(160);